00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "BUnit.h"
00011
00012
00013 class test1 : public TestCase {
00014 enum { N = 2 };
00015 int m_Matrix[N][N];
00016 public:
00017 void setUp() {
00018 for ( int i=0; i<N; ++i ) {
00019 for ( int j=0; j<N; ++j ) {
00020 m_Matrix[i][j] = 0;
00021 }
00022 }
00023 }
00024 bool run() {
00025 for ( int i=0; i<N; ++i ) {
00026 for ( int j=0; j<N; ++j ) {
00027 std::string fail = "m_Matrix";
00028 fail += '[' + TestCase::toString(i) + ']';
00029 fail += '[' + TestCase::toString(j) + ']';
00030 fail += " == 0";
00031 assertTrue_Msg( fail , m_Matrix[i][j] == 0 );
00032 }
00033 }
00034 return wasSuccessful();
00035 }
00036 };
00037
00038 #include <iostream>
00039
00040
00041 int main() {
00042 test1 tester;
00043 tester.run();
00044 if ( ! tester.wasSuccessful() ) {
00045 std::cout << tester.report();
00046 }
00047
00048 tester.reset();
00049 tester.runBare();
00050 std::cout << tester.summary();
00051 return 0;
00052 }
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067