Ignore:
Timestamp:
May 28, 2013, 11:17:14 AM (11 years ago)
Author:
meunier
Message:

Tried to clean the test_regression directory:

  • Code formatting
  • Supressed warnings
  • Made comprehensible outputs
  • Factorized Makefiles

There's still a lot to do (many tests don't pass for either good or bad reasons)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/test_regression/05092005/system.cpp

    r1 r55  
     1
    12#include "systemc.h"
    23
    3 #define ASSERT(x) \
    4   { errnum++; \
    5     if (!(x)) \
    6     { \
    7     cerr << "ASSERT : " #x "\n"; \
    8     exit (errnum); \
    9     } \
    10   }
     4#include "test.h"
    115
    126using namespace std;
    137
    14 struct hard : sc_module
    15 {
    16   sc_in <bool> i;
    17   sc_out<bool> o;
    18   SC_HAS_PROCESS(hard);
    19   hard(sc_module_name)
    20   {
    21   }
     8struct hard : sc_module {
     9    sc_in<bool> i;
     10    sc_out<bool> o;
     11    SC_HAS_PROCESS(hard);
     12    hard(sc_module_name) {}
    2213};
    2314
    24 int
    25 sc_main (int argc, char ** argv)
    26 {
    27   sc_signal<bool> s[5];
    28   hard a("a");
    29   hard b("b");
    30   a.i (s[0]);
    31   a.o (s[1]);
    32   b.i (s[5]); // Wrong array index. This BUG should be detected.
    33   b.o (s[2]);
    3415
    35   sc_initialize ();
    36   sc_start (1);
     16int sc_main (int argc, char ** argv) {
     17    sc_clock signal_clk("my_clock", sc_time(1, sc_core::SC_NS));
     18    sc_signal<bool> s[5];
     19    hard a("a");
     20    hard b("b");
     21    a.i(s[0]);
     22    a.o(s[1]);
     23    b.i(s[5]); // Wrong array index. This BUG should be detected.
     24    b.o(s[2]);
    3725
    38   cerr << "Test KO.\n";
    39   return 0;
     26    sc_start(sc_time(0, sc_core::SC_NS));
     27
     28    sc_start(sc_time(1, sc_core::SC_NS));
     29
     30    return 0;
    4031}
    4132
     33
     34/*
     35# Local Variables:
     36# tab-width: 4;
     37# c-basic-offset: 4;
     38# c-file-offsets:((innamespace . 0)(inline-open . 0));
     39# indent-tabs-mode: nil;
     40# End:
     41#
     42# vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
     43*/
     44
Note: See TracChangeset for help on using the changeset viewer.