From b7a08832127e85f5040dd83ac7d252641b34b2ce Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 30 Jun 2009 23:57:27 -0400 Subject: [PATCH] Unit Tests - Task::validate - Implemented first (of many) Task::validate tests. --- src/tests/t.t.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tests/t.t.cpp b/src/tests/t.t.cpp index 26b585db8..8fe7dec5c 100644 --- a/src/tests/t.t.cpp +++ b/src/tests/t.t.cpp @@ -32,7 +32,7 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest test (36); + UnitTest test (37); test.is ((int)Task::textToStatus ("pending"), (int)Task::pending, "textToStatus pending"); test.is ((int)Task::textToStatus ("completed"), (int)Task::completed, "textToStatus completed"); @@ -153,6 +153,12 @@ TODO Task::*Annotation* left.set ("one", "1.0"); test.notok (left == right, "left == right -> false"); + // Task::validate + Task bad ("[entry:1000000001 start:1000000000]"); + good = true; + try { bad.validate (); } catch (...) { good = false; } + test.notok (good, "Task::validate entry <= start"); + return 0; }