Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (16 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h

    r83 r88  
    1 #ifndef TEST_H
    2 #define TEST_H
     1#ifndef Morpheo_Test_h
     2#define Morpheo_Test_h
     3
     4/*
     5 * $Id$
     6 *
     7 * [ Description ]
     8 *
     9 * Macro / function to test
     10 */
    311
    412#include <iostream>
     
    1119namespace morpheo {
    1220
    13 //-----[ Routine de test ]---------------------------------------
     21#define STR_OK "Test OK"
     22#define STR_KO "Test KO"
    1423
    1524static uint32_t num_test;
     
    2433inline void test_ko (char * file, uint32_t line, T exp1, T exp2)
    2534{
    26   std::cerr << "[" << num_test << "] : Test KO"
     35  fflush (stdout);
     36  fflush (stderr);
     37
     38  std::cerr << "[" << num_test << "] : " << STR_KO
    2739       << "\tline " << line                      << std::endl
    2840       << " * Localisation"                      << std::endl
     
    3850inline void test_ko (char * file, uint32_t line)
    3951{
    40   std::cerr << "[" << num_test << "] : Test KO"
     52  fflush (stdout);
     53  fflush (stderr);
     54
     55  std::cerr << "[" << num_test << "] : " << STR_KO
    4156       << "\tline " << line                           << std::endl
    4257       << " * Localisation"                           << std::endl
     
    4964inline void test_ok ()
    5065{
    51   msg (_("[%d] : Test OK\n"), num_test);
     66  fflush (stdout);
     67  fflush (stderr);
     68
     69  msg (_("[%d] : %s\n"), num_test,STR_OK);
    5270
    5371  num_test ++;
     
    5674inline void test_ok (char * file, uint32_t line)
    5775{
    58   msg (_("[%d] : Test OK\n"), num_test);
     76  fflush (stdout);
     77  fflush (stderr);
     78
     79  msg (_("[%d] : %s\n"), num_test,STR_OK);
    5980  msg (_("\tline %d\n"), line);
    6081
     
    6586inline void test_ok (char * file, uint32_t line, T exp)
    6687{
    67   msg (_("[%d] : Test OK\n"), num_test);
     88  fflush (stdout);
     89  fflush (stderr);
     90
     91  msg (_("[%d] : %s\n"), num_test, STR_OK);
    6892  msg (_("\tline %d\n"), line);
    6993  msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str());
     
    91115    msg (str);                                                          \
    92116    msg (_("\n"));                                                      \
     117    fflush (stdout);                                                    \
    93118  } while(0)
    94 
    95119
    96120#ifndef CYCLE_MAX
     
    109133        }                                                               \
    110134                                                                        \
    111       if (cycle_current > CYCLE_MAX)                                    \
     135      if ((CYCLE_MAX != 0) and (cycle_current > CYCLE_MAX))             \
    112136        {                                                               \
    113137          TEST_KO("Maximal cycles Reached");                            \
Note: See TracChangeset for help on using the changeset viewer.