mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-21 07:43:08 +02:00
Bug Fix - unit test tdb.t
- Fixed two failing unit tests in tdb.t.cpp, which were both due to incorrect test logic, rather than a TDB bug.
This commit is contained in:
parent
d174bb1143
commit
6d8cb5181f
2 changed files with 5 additions and 2 deletions
|
@ -398,6 +398,8 @@ bool TDB::readLockedFile (
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Scans the pending tasks for any that are completed or deleted, and if so,
|
||||||
|
// moves them to the completed.data file. Returns a count of tasks moved.
|
||||||
int TDB::gc ()
|
int TDB::gc ()
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -415,7 +417,9 @@ int TDB::gc ()
|
||||||
// Some tasks stay in the pending file.
|
// Some tasks stay in the pending file.
|
||||||
if (it->getStatus () == T::pending ||
|
if (it->getStatus () == T::pending ||
|
||||||
it->getStatus () == T::recurring)
|
it->getStatus () == T::recurring)
|
||||||
|
{
|
||||||
pending.push_back (*it);
|
pending.push_back (*it);
|
||||||
|
}
|
||||||
|
|
||||||
// Others are transferred to the completed file.
|
// Others are transferred to the completed file.
|
||||||
else
|
else
|
||||||
|
|
|
@ -99,10 +99,9 @@ int main (int argc, char** argv)
|
||||||
|
|
||||||
// Add a new task.
|
// Add a new task.
|
||||||
T t2;
|
T t2;
|
||||||
t2.setId (2);
|
t2.setId (1);
|
||||||
t2.setAttribute ("project", "p2");
|
t2.setAttribute ("project", "p2");
|
||||||
t2.setDescription ("task 2");
|
t2.setDescription ("task 2");
|
||||||
t.diag (t2.compose ());
|
|
||||||
t.ok (tdb.addT (t2), "TDB::addT t2");
|
t.ok (tdb.addT (t2), "TDB::addT t2");
|
||||||
|
|
||||||
// Delete task.
|
// Delete task.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue