Changeset 6802
- Timestamp:
- 07/09/10 17:41:04 (21 months ago)
- Location:
- branches/refactor/UNIT_TESTER
- Files:
-
- 2 modified
-
test_global.h (modified) (2 diffs)
-
test_unit.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/refactor/UNIT_TESTER/test_global.h
r6801 r6802 57 57 58 58 namespace arb_test { 59 class FlushedOutputNo Newline{59 class FlushedOutputNoLF { 60 60 inline void flushall() { fflush(stdout); fflush(stderr); } 61 61 public: 62 FlushedOutputNo Newline() { flushall(); }63 ~FlushedOutputNo Newline() { flushall(); }62 FlushedOutputNoLF() { flushall(); } 63 ~FlushedOutputNoLF() { flushall(); } 64 64 }; 65 struct FlushedOutput : public FlushedOutputNo Newline{65 struct FlushedOutput : public FlushedOutputNoLF { 66 66 ~FlushedOutput() { fputc('\n', stderr); } 67 67 }; 68 68 69 69 class GlobalTestData { 70 70 GlobalTestData() … … 98 98 static void assertfailmsg(const char *filename, int lineno, const char *condition) { 99 99 FlushedOutput yes; 100 fprintf(stderr, "%s:%i: Assertion '%s' failed \n", filename, lineno, condition);100 fprintf(stderr, "%s:%i: Assertion '%s' failed", filename, lineno, condition); 101 101 } 102 102 }; -
branches/refactor/UNIT_TESTER/test_unit.h
r6801 r6802 51 51 52 52 static void printf(const char *format, ...) __attribute__((format(printf, 1, 2))) { 53 FlushedOutputNo Newlineyes;53 FlushedOutputNoLF yes; 54 54 VPRINTFORMAT(format); 55 55 } … … 113 113 } 114 114 template <typename T1, typename T2> void print_failed_equal(T1 t1, T2 t2) { 115 FlushedOutput yes;115 FlushedOutputNoLF yes; 116 116 fputs("is_equal(", stderr); 117 117 print_pair(t1, t2); … … 199 199 } 200 200 201 201 202 202 203 203 inline bool files_are_equal(const char *file1, const char *file2) { 204 const char *error = NULL;205 FILE *fp1 = fopen(file1, "rb");206 FlushedOutput yes;204 const char *error = NULL; 205 FILE *fp1 = fopen(file1, "rb"); 206 FlushedOutputNoLF yes; 207 207 208 208 if (!fp1) {
