00001 #include "tut.h" 00002 00003 //C Normally theres should be no aditional I/O during tests, but it 00004 //C can be useful when writing the class 00005 //#include <iostream> 00006 00007 namespace tut 00008 { 00009 struct GROUP_NAME 00010 { 00011 //C This struct will be initailiased at the start of each test. 00012 //C Use this to set up common data inputs etc... 00013 }; 00014 00015 typedef test_group<GROUP_NAME> GROUP_NAME_group; 00016 GROUP_NAME_group GROUP_NAME_pet("TEST_DESCRIPTION"); 00017 00018 namespace { 00019 //C We use the unnamed namespace here so that the typename "tester" 00020 //C can be reused by every test. 00021 typedef GROUP_NAME_group::object tester; 00022 } 00023 00024 //C Test numbers can run from 1 to 50. They will be performed in 00025 //C order, but need not be sequential. So if you have different 00026 //C categories of tests they can be grouped by category. e.g. 00027 //C 01~10: Basic tests 00028 //C 11~20: Advanced tests 00029 //C 21~30: [...] 00030 //-------------------------------------------------------------------- 00031 template<> template<> 00032 void tester::test<1>() 00033 { 00034 //C See src/unit_test/example_test.cpp for examples of test assertions 00035 //C uncaught throws are also detected as failures. 00036 //C If you want to set the test name use: "set_test_name("some_name");" 00037 } 00038 00039 00040 //-------------------------------------------------------------------- 00041 template<> template<> 00042 void tester::test<2>() 00043 { 00044 00045 } 00046 00047 00048 }; //namespace tut