Changeset 23 for sources/test_regression/28102005
- Timestamp:
- Apr 16, 2009, 2:47:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sources/test_regression/28102005/system.cpp
r18 r23 27 27 check_time (int i) 28 28 { 29 29 const sc_time &t = sc_time_stamp (); 30 30 CERR(i); 31 31 CERR(t.to_double()); 32 #ifdef SYSTEMCASS_SPECIFIC 33 ASSERT((int) (t.to_double ()) == i); 34 #else 32 35 ASSERT((int) (t.to_double ()) == i * 1000); 36 #endif 33 37 CERR(t.to_seconds ()); 34 38 double seconds = t.to_seconds()*1000000000; … … 37 41 char s[256]; 38 42 const char *unit; 43 #ifdef SYSTEMCASS_SPECIFIC 44 unit = "NS"; 45 #else 39 46 if (i == 0) 40 47 unit = "s"; … … 43 50 else 44 51 unit = "ns"; 52 #endif 45 53 sprintf (s, "%d %s", i,unit); 46 54 CERR(s); … … 55 63 56 64 check_time (0); 57 65 sc_start (0); 58 66 59 67 check_time (0); 60 68 sc_start (1); 61 69 check_time (1); 62 70 63 71 sc_start (15); 64 72 check_time (16); 65 73 66 74 sc_start (7); 67 75 check_time (23); 68 76 69 77 sc_start (100); 70 78 check_time (123); 71 79 72 80 sc_start (1000); 73 81 check_time (1123); 74 82 cerr << "Test OK.\n";
Note: See TracChangeset
for help on using the changeset viewer.