From f19a09b3908001a54f95de9154138a423e5227b5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 1 Sep 2011 01:05:59 -0400 Subject: [PATCH] Bug - When handleRecurrence was cloning the parent task, it failed to set a new ID, so all the child tasks were given the ID of the parent. - Cleaned up bug.annual.t. --- src/recur.cpp | 1 + test/bug.annual.t | 26 ++++++++------------------ test/export.yaml.t | 1 + 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/src/recur.cpp b/src/recur.cpp index 41e8d77d9..8c56804dc 100644 --- a/src/recur.cpp +++ b/src/recur.cpp @@ -94,6 +94,7 @@ void handleRecurrence () Task rec (*t); // Clone the parent. rec.setStatus (Task::pending); // Change the status. + rec.id = context.tdb2.next_id (); // New ID. rec.set ("uuid", uuid ()); // New UUID. rec.set ("parent", t->get ("uuid")); // Remember mom. rec.setEntry (); // New entry date. diff --git a/test/bug.annual.t b/test/bug.annual.t index b12d80c17..d9e5b93b0 100755 --- a/test/bug.annual.t +++ b/test/bug.annual.t @@ -28,7 +28,7 @@ use strict; use warnings; -use Test::More tests => 17; +use Test::More tests => 12; # Create the rc file. if (open my $fh, '>', 'annual.rc') @@ -69,23 +69,13 @@ like ($output, qr/10\s+1\/1\/2008\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 10 no cr like ($output, qr/11\s+1\/1\/2009\s+(?:-|\d+\ssecs?)\s+foo/, 'synthetic 11 no creep'); # Cleanup. -unlink 'pending.data'; -ok (!-r 'pending.data', 'Removed pending.data'); - -unlink 'completed.data'; -ok (!-r 'completed.data', 'Removed completed.data'); - -unlink 'undo.data'; -ok (!-r 'undo.data', 'Removed undo.data'); - -unlink 'backlog.data'; -ok (!-r 'backlog.data', 'Removed backlog.data'); - -unlink 'synch.key'; -ok (!-r 'synch.key', 'Removed synch.key'); - -unlink 'annual.rc'; -ok (!-r 'annual.rc', 'Removed annual.rc'); +unlink qw(pending.data completed.data undo.data backlog.data synch.key annual.rc); +ok (! -r 'pending.data' && + ! -r 'completed.data' && + ! -r 'undo.data' && + ! -r 'backlog.data' && + ! -r 'synch_key.data' && + ! -r 'annual.rc', 'Cleanup'); exit 0; diff --git a/test/export.yaml.t b/test/export.yaml.t index 34be1ecb7..239d21126 100755 --- a/test/export.yaml.t +++ b/test/export.yaml.t @@ -40,6 +40,7 @@ if (open my $fh, '>', 'export.rc') } # Add two tasks, export, examine result. +# TODO Add annotations. qx{../src/task rc:export.rc add priority:H project:A one}; qx{../src/task rc:export.rc add +tag1 +tag2 two};