IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1835


Ignore:
Timestamp:
Sep 20, 2004, 12:04:57 PM (22 years ago)
Author:
gusciora
Message:

Added tests for dynamic inheritance.

File:
1 edited

Legend:

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

    r1742 r1835  
    3333                          };
    3434
     35testDescription tests2[] = {
     36                               {testTrace08, 8, "Testing ", 0, false},
     37                           };
     38
    3539int main( int argc, char* argv[] )
    3640{
     
    102106static int testTrace02(void)
    103107{
     108    psTraceReset();
    104109    psTraceSetDestination(stderr);
    105110    psTraceSetLevel(".A.B", 2);
     
    108113    psTraceSetLevel(".A.B", 10);
    109114    psTracePrintLevels();
     115
     116    if (10 != psTraceGetLevel(".A.B.C")) {
     117        fprintf(stderr,"ERROR: .A.B.C did not dynamically inherit a trace level (%d)\n",
     118                psTraceGetLevel(".A.B.C"));
     119        return 2;
     120    }
     121
     122    if (10 != psTraceGetLevel(".A.B.C.D")) {
     123        fprintf(stderr,"ERROR: .A.B.C.D did not dynamically inherit a trace level (%d)\n", psTraceGetLevel(".A.B.C.D"));
     124        return 2;
     125    }
     126
     127    if (5 != psTraceGetLevel(".A.B.C.D.E")) {
     128        fprintf(stderr,"ERROR: .A.B.C.D.E did dynamically inherit a trace level (%d)\n", psTraceGetLevel(".A.B.C.D.E"));
     129        return 2;
     130    }
    110131
    111132    return 0;
     
    289310}
    290311
     312// Ensure that the leading dot in the component names are optional.
    291313static int testTrace08(void)
    292314{
     315    psTraceReset();
    293316    (void)psTraceSetLevel(".", 9);
    294317
     
    306329    (void)psTraceSetLevel(".c.b", 3);
    307330    (void)psTraceSetLevel(".c.c", 5);
     331
     332    psTracePrintLevels();
    308333
    309334    if ((psTraceGetLevel(".")!=9) ||
     
    318343            (psTraceGetLevel("c.b")!=3) ||
    319344            (psTraceGetLevel("c.c")!=5)) {
     345        printf("psTraceGetLevel(.) is %d\n", psTraceGetLevel("."));
     346        printf("psTraceGetLevel(a) is %d\n", psTraceGetLevel("a"));
     347        printf("psTraceGetLevel(b) is %d\n", psTraceGetLevel("b"));
     348        printf("psTraceGetLevel(c) is %d\n", psTraceGetLevel("c"));
     349        printf("psTraceGetLevel(a.a) is %d\n", psTraceGetLevel("a.a"));
     350        printf("psTraceGetLevel(a.b) is %d\n", psTraceGetLevel("a.b"));
     351        printf("psTraceGetLevel(b.a) is %d\n", psTraceGetLevel("b.a"));
     352        printf("psTraceGetLevel(b.b) is %d\n", psTraceGetLevel("b.b"));
     353        printf("psTraceGetLevel(c.a) is %d\n", psTraceGetLevel("c.a"));
     354        printf("psTraceGetLevel(c.b) is %d\n", psTraceGetLevel("c.b"));
     355        printf("psTraceGetLevel(c.c) is %d\n", psTraceGetLevel("c.c"));
     356
    320357        return 1;
    321358    }
     
    323360    return 0;
    324361}
    325 
Note: See TracChangeset for help on using the changeset viewer.