Navigation


Changeset 2:d8ce06172629 in freeDiameter for freeDiameter


Ignore:
Timestamp:
Aug 31, 2009, 5:32:22 PM (15 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added a global debug level var

Location:
freeDiameter
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/CMakeLists.txt

    r1 r2  
    1818TARGET_LINK_LIBRARIES(freeDiameterd libfreeDiameter ${FD_LIBS})
    1919
     20# Save the list of files, if needed
     21SET(FD_COMMON_SRC ${FD_COMMON_SRC} PARENT_SCOPE)
     22
    2023# The unary tests directory
    2124OPTION(SKIP_TESTS "Skip compilation of the tests?" OFF)
  • freeDiameter/tests/CMakeLists.txt

    r1 r2  
    2020# Some parameters for the tests
    2121
    22 # Add this flag to add some debug information in the tests themselves
    2322ADD_DEFINITIONS(-DTEST_DEBUG)
     23ADD_DEFINITIONS(-DTRACE_LEVEL=NONE)
    2424
    2525INCLUDE_DIRECTORIES( ".." )
     26INCLUDE_DIRECTORIES( "../../libfreeDiameter" )
    2627
    2728SET(TEST_COMMON_SRC "")
     
    3536# ENDFOREACH(SRC_FILE)
    3637
     38FOREACH( SRC_FILE ${LFD_SRC})
     39   SET(TEST_COMMON_SRC ${TEST_COMMON_SRC} "../../libfreeDiameter/${SRC_FILE}")
     40ENDFOREACH(SRC_FILE)
     41
    3742# Create an archive with the daemon common files (all but main)
    3843ADD_LIBRARY(fDcore STATIC ${TEST_COMMON_SRC})
     
    4348FOREACH( TEST ${TEST_LIST} )
    4449   ADD_EXECUTABLE(${TEST} ${TEST}.c tests.h)
    45    TARGET_LINK_LIBRARIES(${TEST} libfreeDiameter fDcore ${FD_LIBS})
     50   TARGET_LINK_LIBRARIES(${TEST} fDcore ${FD_LIBS})
    4651   ADD_TEST(${TEST} ${EXECUTABLE_OUTPUT_PATH}/${TEST})
    4752ENDFOREACH( TEST )
  • freeDiameter/tests/testmesg.c

    r1 r2  
    436436                                memset(&buf, 0, sizeof(buf)); /* Test that the OS value is really copied */
    437437                                CHECK( 0, fd_msg_update_length ( avpi ) );
    438                                 #if 1
     438                                #if 0
    439439                                fd_log_debug("AVP octet string, 'This\\0 is a b...'\n");
    440440                                fd_msg_dump_one(0, avpi);
  • freeDiameter/tests/tests.h

    r1 r2  
    5252#endif /* TEST_TIMEOUT */
    5353
    54 static int test_verbosity = 0;
    55 
    5654/* Standard includes */
    5755#include <getopt.h>
     
    7674}
    7775
     76static int test_verbo = 0;
     77
    7878/* Define the standard check routines */
    7979#define CHECK( _val, _assert ){                         \
    80         if (test_verbosity > 0) {                       \
     80        if (test_verbo > 0) {                           \
    8181                fprintf(stderr,                         \
    8282                        "%s:%-4d: CHECK( " #_assert " == "\
     
    111111                switch (c) {
    112112                        case 'd':       /* Increase verbosity of debug messages.  */
    113                                 test_verbosity++;
     113                                test_verbo++;
    114114                                break;
    115115                               
    116                         case 'q':       /* Decrease verbosity then remove debug messages.  */
    117                                 test_verbosity--;
     116                        case 'q':       /* Decrease verbosity.  */
     117                                test_verbo--;
    118118                                break;
    119119                       
     
    126126                }
    127127        }
     128        fd_g_debug_lvl = (test_verbo > 0) ? (test_verbo - 1) : 0;
    128129        if (!no_timeout)
    129130                alarm(TEST_TIMEOUT);
Note: See TracChangeset for help on using the changeset viewer.