Changeset 477 for library/tests/loggers_test.cpp
- Timestamp:
- 08/05/09 14:40:03 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/tests/loggers_test.cpp
r470 r477 10 10 using namespace bdm; 11 11 12 TEST(test_dirfilelog) 13 { 14 RV th = RV("{alog blog }"); 15 RV r = RV("{r }", "2"); 12 TEST ( test_dirfilelog ) { 13 RV th = RV ( "{alog blog }" ); 14 RV r = RV ( "{r }", "2" ); 16 15 17 string ls("exp");18 remove_all(ls.c_str());19 makedir(ls, false);20 remove_all("exp/dirfile");16 string ls ( "exp" ); 17 remove_all ( ls.c_str() ); 18 makedir ( ls, false ); 19 remove_all ( "exp/dirfile" ); 21 20 22 dirfilelog L("exp/dirfile", 10);21 dirfilelog L ( "exp/dirfile", 10 ); 23 22 24 25 23 int rid; 24 int thid; 26 25 27 rid = L.add(r, "");28 thid = L.add(th, "th");26 rid = L.add ( r, "" ); 27 thid = L.add ( th, "th" ); 29 28 30 29 L.init(); 31 30 32 for (int i = 0; i < 150; i++) {33 L.logit(rid, vec_2((double)i, (double)(i + 1)));34 L.logit(thid, vec_2((double)(100 - i), (double)(i - 50)));35 36 31 for ( int i = 0; i < 150; i++ ) { 32 L.logit ( rid, vec_2 ( ( double ) i, ( double ) ( i + 1 ) ) ); 33 L.logit ( thid, vec_2 ( ( double ) ( 100 - i ), ( double ) ( i - 50 ) ) ); 34 L.step(); 35 } 37 36 38 37 L.finalize(); 39 38 40 std::string expected(load_test_file("dirfile-format.matrix"));41 std::string actual(load_test_file("exp/dirfile/format"));42 CHECK_EQUAL(expected, actual);39 std::string expected ( load_test_file ( "dirfile-format.matrix" ) ); 40 std::string actual ( load_test_file ( "exp/dirfile/format" ) ); 41 CHECK_EQUAL ( expected, actual ); 43 42 }