IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1151


Ignore:
Timestamp:
Jun 30, 2004, 10:21:21 AM (22 years ago)
Author:
desonia
Message:

enhanced test to exercise the new logging to file option.

Location:
trunk/psLib/test/sysUtils
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/sysUtils/builddir/tst_psLogMsg03.d

    r1109 r1151  
    33  ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
    44  ../../include/psString.h ../../include/psType.h ../../include/psList.h \
    5   ../../include/psVector.h ../../include/psHash.h \
    6   ../../include/psScalar.h ../../include/psImage.h \
     5  ../../include/psCompare.h ../../include/psVector.h \
     6  ../../include/psHash.h ../../include/psScalar.h ../../include/psImage.h \
    77  ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
    88  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
  • trunk/psLib/test/sysUtils/tst_psLogMsg03.c

    r963 r1151  
    1515    int testStatus = true;
    1616    int currentId = psMemGetId();
     17    FILE* file;
     18    char line[256];
    1719
    1820    printPositiveTestHeader(stdout,
     
    2022                            "psLogSetDestination()");
    2123
    22     printf("------------- psLogSetDestination(PS_LOG_NONE) -------------\n");
    23     psLogSetDestination(PS_LOG_NONE);
     24    printf("--------------- psLogSetDestination(PS_LOG_NONE) ----------------\n");
     25    psLogSetDestination("none");
    2426    for (i=0;i<10;i++) {
    2527        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
     
    2729
    2830    printf("------------- psLogSetDestination(PS_LOG_TO_STDERR) -------------\n");
    29     psLogSetDestination(PS_LOG_TO_STDERR);
     31    psLogSetDestination("dest:stderr");
    3032    for (i=0;i<10;i++) {
    3133        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
     
    3335
    3436    printf("------------- psLogSetDestination(PS_LOG_TO_STDOUT) -------------\n");
    35     psLogSetDestination(PS_LOG_TO_STDOUT);
     37    psLogSetDestination("dest:stdout");
    3638    for (i=0;i<10;i++) {
    3739        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
    3840    }
     41    printf("--------------- psLogSetDestination(""file:log.txt"") ---------------\n");
     42    psLogSetDestination("file:log.txt");
     43    for (i=0;i<10;i++) {
     44        psLogMsg(__func__, i, "Hello World!  My level is %d\n", i);
     45    }
     46
     47    psLogSetDestination("none");
     48    printf("--------------------- The Contents of log.txt -------------------\n");
     49    file = fopen("log.txt","r");
     50    while ( fgets(line,256,file) != NULL ) {
     51        printf("%s",line);
     52    }
     53    fclose(file);
    3954
    4055    printFooter(stdout,
Note: See TracChangeset for help on using the changeset viewer.