diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index e1fe06a99..625dbcd26 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -300,35 +300,8 @@ int CmdDiagnostics::execute (std::string& output) << Context::getContext ().getHeight () << '\n'; - // Scan tasks for duplicate UUIDs. - auto all = Context::getContext ().tdb2.all_tasks (); - std::map seen; - std::vector dups; - std::string uuid; - for (auto& i : all) - { - uuid = i.get ("uuid"); - if (seen.find (uuid) != seen.end ()) - dups.push_back (uuid); - else - seen[uuid] = 0; - } - - out << " Dups: " - << format ("Scanned {1} tasks for duplicate UUIDs:", all.size ()) - << '\n'; - - if (dups.size ()) - { - for (auto& d : dups) - out << " " << format ("Found duplicate {1}", d) << '\n'; - } - else - { - out << " No duplicates found\n"; - } - // Check all the UUID references + auto all = Context::getContext ().tdb2.all_tasks (); bool noBrokenRefs = true; out << " Broken ref: " diff --git a/test/recurrence.test.py b/test/recurrence.test.py index 313b9e803..41b3c4c5a 100755 --- a/test/recurrence.test.py +++ b/test/recurrence.test.py @@ -206,11 +206,6 @@ class TestRecurrenceTasks(TestCase): code, out, err = self.t("3 delete", input="y\n") self.assertIn("Deleted 1 task.", out) - # Check for duplicate UUIDs. - code, out, err = self.t("diag") - self.assertIn("No duplicates found", out) - - class TestBug972(TestCase): def setUp(self): """972: Executed before each test in the class""" @@ -478,11 +473,6 @@ class TestBug360AllowedChanges(BaseTestBug360): expected = "You cannot remove the due date from a recurring task." self.assertNotIn(expected, err) - # Make sure no duplicate tasks were created - code, out, err = self.t.diag() - expected = "No duplicates found" - self.assertIn(expected, out) - class TestBug649(TestCase): def setUp(self): """Executed before each test in the class""" @@ -602,11 +592,6 @@ class TestPeriod(TestCase): self.assertIn(" 2q ", out); self.assertIn(" 2y ", out); - # Duplicate check - code, out, err = self.t("diag") - self.assertIn("No duplicates found", out) - - class TestBugAnnual(TestCase): def setUp(self): """Executed before each test in the class""" diff --git a/test/uuid.test.py b/test/uuid.test.py index 55fe20169..48bd0be12 100755 --- a/test/uuid.test.py +++ b/test/uuid.test.py @@ -174,42 +174,6 @@ class TestUUID(TestCase): self.assertIn('"description":"seven"', out) -class TestUUIDuplicates(TestCase): - def setUp(self): - """Executed before each test in the class""" - self.t = Task() - - def test_uuid_duplicates_dupe(self): - """Verify that duplicating tasks does not create duplicate UUIDs""" - self.t("add simple") - self.t("1 duplicate") - - uuids = list() - for id in range(1,3): - code, out, err = self.t("_get %d.uuid" % id) - uuids.append(out.strip()) - - self.assertEqual(len(uuids), len(set(uuids))) - - code, out, err = self.t("diag") - self.assertIn("No duplicates found", out) - - def test_uuid_duplicates_recurrence(self): - """Verify that recurring tasks do not create duplicate UUIDs""" - print(self.t("add periodic recur:daily due:yesterday")) - self.t("list") # GC/handleRecurrence - - uuids = list() - for id in range(1,5): - code, out, err = self.t("_get %d.uuid" % id) - uuids.append(out.strip()) - - self.assertEqual(len(uuids), len(set(uuids))) - - code, out, err = self.t("diag") - self.assertIn("No duplicates found", out) - - class TestBug954(TestCase): def setUp(self): """Executed before each test in the class"""