IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 4, 2008, 2:09:04 PM (18 years ago)
Author:
eugene
Message:

merging from eam_branch_20080430 : cleanups for tests, minor fixes from tests, reduced verbosity level in some places, add UPDATE and RESET directives to MULTI and METADATA in config files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sys/tap_psTrace.c

    r12781 r17515  
    1919    plan_tests(54);
    2020
     21# define DEBUG 1
     22# if (DEBUG)
     23    FILE *output = fopen ("/dev/null", "w");
     24    int outFD = fileno (output);
     25# else
     26    int outFD = 2;
     27# endif
     28
    2129    // testTrace00()
    2230    {
    2331        psMemId id = psMemGetId();
    2432        psS32 lev = 0;
    25         (void)psTraceSetDestination(2);
     33        (void)psTraceSetDestination(outFD);
    2634        for (int i=0;i<10;i++) {
    2735            (void)psTraceSetLevel(".", i);
     
    5866    {
    5967        psMemId id = psMemGetId();
    60         (void)psTraceSetDestination(2);
     68        (void)psTraceSetDestination(outFD);
    6169        (void)psTraceSetLevel(".A.B.C.D.E", 5);
    6270        psTrace(".A.C.D.C",1,"You should not see this");
     
    7280        psMemId id = psMemGetId();
    7381        psTraceReset();
    74         (void)psTraceSetDestination(2);
     82        (void)psTraceSetDestination(outFD);
    7583        (void)psTraceSetLevel(".A.B", 2);
    7684        (void)psTraceSetLevel(".A.B.C.D.E", 5);
     
    97105    {
    98106        psMemId id = psMemGetId();
    99         (void)psTraceSetDestination(2);
     107        (void)psTraceSetDestination(outFD);
    100108
    101109        for (int i=0;i<10;i++) {
     
    134142        for (int nb = 0 ; nb<4;nb++) {
    135143            if (nb == 0)
    136                 (void)psTraceSetDestination(1);
     144                (void)psTraceSetDestination(((outFD == 2) ? 1 : outFD));
    137145            if (nb == 1)
    138                 (void)psTraceSetDestination(2);
     146                (void)psTraceSetDestination(((outFD == 2) ? 2 : outFD));
    139147            if (nb == 2)
    140                 (void)psTraceSetDestination(0);
     148                (void)psTraceSetDestination(((outFD == 2) ? 0 : outFD));
    141149            if (nb == 3)
    142150                (void)psTraceSetDestination(FD);
     
    174182    {
    175183        psMemId id = psMemGetId();
    176         (void)psTraceSetDestination(2);
     184        (void)psTraceSetDestination(outFD);
    177185        (void)psTraceSetLevel(".", 9);
    178186        (void)psTraceSetLevel(".a", 8);
     
    213221    {
    214222        psMemId id = psMemGetId();
    215         (void)psTraceSetDestination(2);
     223        (void)psTraceSetDestination(outFD);
    216224        (void)psTraceSetLevel(".", 9);
    217225        (void)psTraceSetLevel(".a", 8);
     
    287295        ok(!psMemCheckLeaks(id, NULL, NULL, false), "no memory leaks");
    288296    }
     297
     298# if (DEBUG)
     299    close (outFD);
     300# endif
     301
    289302}
Note: See TracChangeset for help on using the changeset viewer.