From 963d13b306aba88c86838f885d87de9aad9bb318 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Wed, 20 Feb 2013 00:35:45 +0100 Subject: digital/ucoolib/ucoolib/base/test: use an object to track running test --- .../ucoolib/ucoolib/base/test/test/test_test.cc | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'digital/ucoolib/ucoolib/base/test/test/test_test.cc') diff --git a/digital/ucoolib/ucoolib/base/test/test/test_test.cc b/digital/ucoolib/ucoolib/base/test/test/test_test.cc index baf70a38..88bad02d 100644 --- a/digital/ucoolib/ucoolib/base/test/test/test_test.cc +++ b/digital/ucoolib/ucoolib/base/test/test/test_test.cc @@ -28,17 +28,21 @@ int main (int argc, const char **argv) { ucoo::arch_init (argc, argv); - ucoo::Test test ("test_test"); + ucoo::TestSuite test_suite ("test_test"); // Really, what a dumb test! - test.group ("group one"); - test.begin ("the first test"); - test.fail ("Oh no! test %d!", 123); - test.begin ("try again"); - test.info ("working harder..."); - test.pass (); - test.group ("group two"); - test.begin ("simple test"); - test.pass (); - return test.report () ? 0 : 1; + test_suite.group ("group one"); + { + ucoo::Test test (test_suite, "the first test"); + test.fail ("Oh no! test %d!", 123); + } + { + ucoo::Test test (test_suite, "try again"); + test.info ("working harder..."); + } + test_suite.group ("group two"); + { + ucoo::Test test (test_suite, "simple test"); + } + return test_suite.report () ? 0 : 1; } -- cgit v1.2.3