IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 8, 2004, 12:09:07 PM (22 years ago)
Author:
desonia
Message:

fixed destination problems in psTrace testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/tst_psTrace.c

    r1698 r1732  
    4141    int lev = 0;
    4242
     43    psTraceSetDestination(stderr);
     44
    4345    for (i=0;i<10;i++) {
    4446        (void)psTraceSetLevel(".", i);
    4547        lev = psTraceGetLevel(".");
    4648        if (lev != i) {
    47             printf("ERROR: (.) expected trace level was %d, actual was %d\n",
    48                    i, lev);
     49            fprintf(stderr,"ERROR: (.) expected trace level was %d, actual was %d\n",
     50                    i, lev);
    4951            return 1;
    5052        }
     
    5658        lev = psTraceGetLevel(".NODE00");
    5759        if (lev != i) {
    58             printf("ERROR: (.NODE00) expected trace level was %d, actual was %d\n",
    59                    i, lev);
     60            fprintf(stderr,"ERROR: (.NODE00) expected trace level was %d, actual was %d\n",
     61                    i, lev);
    6062            return 2;
    6163        }
     
    6365        lev = psTraceGetLevel(".");
    6466        if (lev != 3) {
    65             printf("ERROR: (.) expected trace level was %d, actual was %d\n",
    66                    i, 3);
     67            fprintf(stderr,"ERROR: (.) expected trace level was %d, actual was %d\n",
     68                    i, 3);
    6769            return 3;
    6870        }
     
    7577        lev = psTraceGetLevel(".NODE00.NODE01");
    7678        if (lev != i) {
    77             printf("ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",
    78                    i, lev);
     79            fprintf(stderr,"ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",
     80                    i, lev);
    7981            return 4;
    8082        }
     
    8688static int testTrace01(void)
    8789{
     90    psTraceSetDestination(stderr);
    8891    (void)psTraceSetLevel(".A.B.C.D.E", 5);
    8992
     
    9598static int testTrace02(void)
    9699{
     100    psTraceSetDestination(stderr);
    97101    psTraceSetLevel(".A.B", 2);
    98102    psTraceSetLevel(".A.B.C.D.E", 5);
     
    108112    int i = 0;
    109113    int lev = 0;
     114
     115    psTraceSetDestination(stderr);
    110116
    111117    for (i=0;i<10;i++) {
     
    115121        lev = psTraceGetLevel(".");
    116122        if (lev != PS_UNKNOWN_TRACE_LEVEL) {
    117             printf("ERROR: expected trace level was %d, actual was %d\n",
    118                    PS_UNKNOWN_TRACE_LEVEL, lev);
     123            fprintf(stderr,"ERROR: expected trace level was %d, actual was %d\n",
     124                    PS_UNKNOWN_TRACE_LEVEL, lev);
    119125            return 1;
    120126        }
     
    128134            (3 != psTraceGetLevel(".a.b")) ||
    129135            (2 != psTraceGetLevel(".a.b.c"))) {
    130         printf("ERROR: trace successFlag = false;levels were not settable?\n");
     136        fprintf(stderr,"ERROR: trace successFlag = false;levels were not settable?\n");
    131137        return 2;
    132138    }
     
    137143            (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b")) ||
    138144            (PS_UNKNOWN_TRACE_LEVEL != psTraceGetLevel(".a.b.c"))) {
    139         printf("ERROR: trace levels were not reset properly\n");
     145        fprintf(stderr,"ERROR: trace levels were not reset properly\n");
    140146        return 3;
    141147    }
     
    161167            psTraceSetDestination(fp);
    162168
    163         printPositiveTestHeader(stdout,
    164                                 "psTrace functions",
    165                                 "psTrace()");
    166 
    167169        (void)psTraceSetLevel(".", 4);
    168170        psTrace(".", 5, "(0) This message should not be displayed (%x)\n",
     
    196198static int testTrace05(void)
    197199{
     200    psTraceSetDestination(stderr);
     201
    198202    (void)psTraceSetLevel(".", 9);
    199203
     
    220224static int testTrace06(void)
    221225{
     226    psTraceSetDestination(stderr);
     227
    222228    (void)psTraceSetLevel(".", 9);
    223229
Note: See TracChangeset for help on using the changeset viewer.