IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 1, 2004, 1:04:35 PM (22 years ago)
Author:
gusciora
Message:

This is a fairly large checkin. I had been sitting on a lot of test code
that was not quite in sync with the current test harness. I modified it
somewhat so it mostly works with the test harness, though there are still
problems with the printFooter() function not having a status for "status
unknown". Also, the runTest is not correctly parsing my date strings in
psLogMsg calls. Also, I added an individual entry for each test in the
Makefile in the test directory. I did this because the generic rules were
failing, and I did not want to break the tests for those people who were
successfully using the generic rules.

Location:
trunk/psLib/test/sysUtils
Files:
30 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/Makefile

    r557 r560  
    33##  Makefile:   test/sysUtils
    44##
    5 ##  $Revision: 1.5 $  $Name: not supported by cvs2svn $
    6 ##  $Date: 2004-04-30 06:19:57 $
     5##  $Revision: 1.6 $  $Name: not supported by cvs2svn $
     6##  $Date: 2004-05-01 23:04:35 $
    77##
    88##  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1010###############################################################################
    1111
     12###############################################################################
     13#    Note: I added specific entries for the psTrace files.  The reason I did
     14#    this was because the generic rules were failing on the existing test
     15#    code (and hence, on my tst_psTraceXX.c code as well).  I am tempted to
     16#    fix the generic rules, but that might break existing codes.  When this
     17#    problem is resolved, I'll remove the specific rules for psTrace.  -GLG
     18#    Also, psLogMsg.
     19#    Also, psHash.
     20###############################################################################
    1221include ../../src/Makefile.Globals
    1322
     
    2029         atst_psAbort_02    \
    2130         atst_psAbort_03    \
    22          tst_psTrace00      \
    23          tst_psTrace01      \
    24          tst_psTrace02      \
    25          tst_psTrace03      \
    2631         tst_psStringCopy
     32TARGET_TRACE = tst_psTrace00 tst_psTrace01 tst_psTrace02 tst_psTrace03 \
     33               tst_psTrace04
     34TARGET_LOGMSG = tst_psLogMsg00 tst_psLogMsg01 tst_psLogMsg02 tst_psLogMsg03
     35TARGET_HASH = tst_psHash00 tst_psHash01 tst_psHash02 tst_psHash03 tst_psHash04
    2736
    28 all: $(TARGET)
     37all:            $(TARGET)
     38psTrace:        $(TARGET_TRACE)
     39psLogMsg:       $(TARGET_LOGMSG)
     40psHash: $(TARGET_HASH)
    2941
    3042tst_psError: tst_psError.o
     
    3749        @echo "    Deleting executable and binary files for 'test/sysUtils'"
    3850        $(RM) $(TARGET) *.o *.lint
     51
     52tst_psHash00:   tst_psHash00.c
     53        $(CC) tst_psHash00.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash00
     54
     55tst_psHash01:   tst_psHash01.c
     56        $(CC) tst_psHash01.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash01
     57
     58tst_psHash02:   tst_psHash02.c
     59        $(CC) tst_psHash02.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash02
     60
     61tst_psHash03:   tst_psHash03.c
     62        $(CC) tst_psHash03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash03
     63
     64tst_psHash04:   tst_psHash04.c
     65        $(CC) tst_psHash04.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psHash04
     66
     67tst_psLogMsg00: tst_psLogMsg00.c
     68        $(CC) tst_psLogMsg00.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg00
     69
     70tst_psLogMsg01: tst_psLogMsg01.c
     71        $(CC) tst_psLogMsg01.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg01
     72
     73tst_psLogMsg02: tst_psLogMsg02.c
     74        $(CC) tst_psLogMsg02.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg02
     75
     76tst_psLogMsg03: tst_psLogMsg03.c
     77        $(CC) tst_psLogMsg03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psLogMsg03
    3978
    4079tst_psTrace00:  tst_psTrace00.c
     
    5089        $(CC) tst_psTrace03.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace03
    5190
     91tst_psTrace04:  tst_psTrace04.c
     92        $(CC) tst_psTrace04.c $(LDFLAGS) -L$(PSLIB_LIB_DIR) -L.. -lpslib -lpstest -I$(PSLIB_INCL_DIR) -I.. -o tst_psTrace04
     93
    5294%.o : %.c
    5395        $(CC) $(CFLAGS) $(CPPFLAGS) -I.. -I$(PSLIB_INCL_DIR) -c -o $@ $<
     
    60102
    61103distclean:
    62         rm DistCleanFiles
     104        rm -rf $(TARGET_TRACE) $(TARGET_LOGMSG) $(TARGET_HASH)
  • trunk/psLib/test/sysUtils/tst_psTrace00.c

    r558 r560  
    1010    int i = 0;
    1111    int lev = 0;
    12     int errorFlag = true;
     12    int testStatus = true;
    1313
    14     printPositiveTestHeader(stderr,
     14    printPositiveTestHeader(stdout,
    1515                            "psTrace functions",
    16                             "Testing psSetTraceLevel and psGetTraceLevel");
     16                            "psSetTraceLevel() and psGetTraceLevel()");
    1717    for (i=0;i<10;i++) {
    1818        psSetTraceLevel(".", i);
     
    2121            printf("ERROR: (.) expected trace level was %d, actual was %d\n",
    2222                   i, lev);
    23             errorFlag = false;
     23            testStatus = false;
    2424        }
    2525    }
     
    3232            printf("ERROR: (.NODE00) expected trace level was %d, actual was %d\n",
    3333                   i, lev);
    34             errorFlag = false;
     34            testStatus = false;
    3535        }
    3636
     
    3939            printf("ERROR: (.) expected trace level was %d, actual was %d\n",
    4040                   i, 3);
    41             errorFlag = false;
     41            testStatus = false;
    4242        }
    4343    }
     
    5151            printf("ERROR: (.NODE00.NODE01) expected trace level was %d, actual was %d\n",
    5252                   i, lev);
    53             errorFlag = false;
     53            testStatus = false;
    5454        }
    5555    }
    5656
    57     printFooter(stderr,
     57    printFooter(stdout,
    5858                "psTrace functions",
    5959                "Testing psSetTraceLevel and psGetTraceLevel",
    60                 errorFlag);
    61     exit(0);
     60                testStatus);
     61    exit(!testStatus);
    6262}
  • trunk/psLib/test/sysUtils/tst_psTrace01.c

    r555 r560  
    1212    int successFlag = true;
    1313
    14     printPositiveTestHeader(stderr,
     14    printPositiveTestHeader(stdout,
    1515                            "psTrace functions",
    16                             "Testing psTraceReset()");
     16                            "psTraceReset()");
    1717
    1818    for (i=0;i<10;i++) {
     
    2121
    2222        lev = psGetTraceLevel(".");
    23         if (lev != UNKNOWN_TRACE_LEVEL) {
     23        if (lev != DEFAULT_TRACE_LEVEL) {
    2424            printf("ERROR: expected trace level was %d, actual was %d\n",
    2525                   i, lev);
     
    3232    psSetTraceLevel(".a.b.c", 2);
    3333    psTraceReset();
    34     if ((UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".")) ||
    35             (UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".a")) ||
    36             (UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".a.b")) ||
    37             (UNKNOWN_TRACE_LEVEL != psGetTraceLevel(".a.b.c"))) {
     34    if ((DEFAULT_TRACE_LEVEL != psGetTraceLevel(".")) ||
     35            (DEFAULT_TRACE_LEVEL != psGetTraceLevel(".a")) ||
     36            (DEFAULT_TRACE_LEVEL != psGetTraceLevel(".a.b")) ||
     37            (DEFAULT_TRACE_LEVEL != psGetTraceLevel(".a.b.c"))) {
    3838        printf("ERROR: trace levels were not reset properly\n");
    3939        successFlag = false;
    4040    }
    4141
    42     printFooter(stderr,
     42    printFooter(stdout,
    4343                "psTrace functions",
    44                 "Testing psTraceReset()",
     44                "psTraceReset()",
    4545                successFlag);
    46     exit(0);
     46
     47    exit(!successFlag);
    4748}
  • trunk/psLib/test/sysUtils/tst_psTrace02.c

    r555 r560  
    1212    int lev = 0;
    1313    int errorFlag = 0;
     14
     15    printPositiveTestHeader(stdout,
     16                            "psTrace functions",
     17                            "psTrace()");
    1418
    1519    psSetTraceLevel(".", 4);
     
    3539            0xbeefface);
    3640
     41    printFooter(stdout,
     42                "psTrace functions",
     43                "psTrace()",
     44                true);
     45
    3746    exit(0);
    3847}
  • trunk/psLib/test/sysUtils/tst_psTrace03.c

    r558 r560  
    99main()
    1010{
     11    printPositiveTestHeader(stdout,
     12                            "psTrace functions",
     13                            "psTracePrintLevels()");
     14
    1115    psSetTraceLevel(".", 9);
    1216
     
    2630
    2731    psPrintTraceLevels();
     32
     33    printFooter(stdout,
     34                "psTrace functions",
     35                "psTracePrintLevels()",
     36                true);
     37
    2838    exit(0);
    2939}
  • trunk/psLib/test/sysUtils/verified/tst_psTrace00.stderr

    r554 r560  
    1 /----------------------------- TESTPOINT --------------------------------\
    2 |   TestFile: tst_psTrace00.c                                            |
    3 |  TestPoint: psTrace functions{Testing psSetTraceLevel and psGetTraceLevel} |
    4 |   TestType: Positive                                                   |
    5 \------------------------------------------------------------------------/
    6 
    7 
    8 ---> TESTPOINT PASSED (psTrace functions{Testing psSetTraceLevel and psGetTraceLevel} | tst_psTrace00.c)
    9 
  • trunk/psLib/test/sysUtils/verified/tst_psTrace00.stdout

    r554 r560  
     1/----------------------------- TESTPOINT --------------------------------\
     2|   TestFile: tst_psTrace00.c                                            |
     3|  TestPoint: psTrace functions{psSetTraceLevel() and psGetTraceLevel()} |
     4|   TestType: Positive                                                   |
     5\------------------------------------------------------------------------/
     6
     7
     8---> TESTPOINT PASSED (psTrace functions{Testing psSetTraceLevel and psGetTraceLevel} | tst_psTrace00.c)
     9
  • trunk/psLib/test/sysUtils/verified/tst_psTrace01.stderr

    r554 r560  
    1 /----------------------------- TESTPOINT --------------------------------\
    2 |   TestFile: tst_psTrace01.c                                            |
    3 |  TestPoint: psTrace functions{Testing psTraceReset()}                  |
    4 |   TestType: Positive                                                   |
    5 \------------------------------------------------------------------------/
    6 
    7 
    8 ---> TESTPOINT PASSED (psTrace functions{Testing psTraceReset()} | tst_psTrace01.c)
    9 
  • trunk/psLib/test/sysUtils/verified/tst_psTrace01.stdout

    r554 r560  
     1/----------------------------- TESTPOINT --------------------------------\
     2|   TestFile: tst_psTrace01.c                                            |
     3|  TestPoint: psTrace functions{psTraceReset()}                          |
     4|   TestType: Positive                                                   |
     5\------------------------------------------------------------------------/
     6
     7
     8---> TESTPOINT PASSED (psTrace functions{psTraceReset()} | tst_psTrace01.c)
     9
  • trunk/psLib/test/sysUtils/verified/tst_psTrace02.stdout

    r554 r560  
     1/----------------------------- TESTPOINT --------------------------------\
     2|   TestFile: tst_psTrace02.c                                            |
     3|  TestPoint: psTrace functions{psTrace()}                               |
     4|   TestType: Positive                                                   |
     5\------------------------------------------------------------------------/
     6
    17     (0) This message should be displayed (beefface)
    28     (1) This message should be displayed (beefface)
    39     (2) This message should be displayed (beefface)
     10
     11---> TESTPOINT PASSED (psTrace functions{psTrace()} | tst_psTrace02.c)
     12
  • trunk/psLib/test/sysUtils/verified/tst_psTrace03.stdout

    r558 r560  
     1/----------------------------- TESTPOINT --------------------------------\
     2|   TestFile: tst_psTrace03.c                                            |
     3|  TestPoint: psTrace functions{psTracePrintLevels()}                    |
     4|   TestType: Positive                                                   |
     5\------------------------------------------------------------------------/
     6
    17.                    9
    28 a                   8
     
    1016  b                  3
    1117  c                  5
     18
     19---> TESTPOINT PASSED (psTrace functions{psTracePrintLevels()} | tst_psTrace03.c)
     20
Note: See TracChangeset for help on using the changeset viewer.