IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2006, 1:31:22 PM (20 years ago)
Author:
drobbin
Message:

started working on test for psStringSplit

File:
1 edited

Legend:

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

    r4547 r6211  
    2020 *  @author  Eric Van Alst, MHPCC
    2121 *
    22  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    23  *  @date  $Date: 2005-07-13 02:47:01 $
     22 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     23 *  @date  $Date: 2006-01-26 23:31:22 $
    2424 *
    2525 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5050static psS32 testStrPrepend02(void);
    5151static psS32 testStrPrepend03(void);
     52
     53static psS32 testStrSplit00(void);
    5254
    5355testDescription tests[] = {
     
    6971                              {testStrPrepend02,13, "Verify prepend string creation", 0, false},
    7072                              {testStrPrepend03,14, "Test prepend null-op", 0, false},
     73                              {testStrSplit00,15, "Test String Splitting", 0, false},
    7174                              {NULL}
    7275                          };
     
    435438    return 0;
    436439}
     440
     441static psS32 testStrSplit00(void)
     442{
     443    psList *strList = NULL;
     444    char str[30];
     445    char split[5];
     446    strncpy(str, "This is, a, test case, to check.", 30);
     447    strncpy(split, ",", 2);
     448    psString psStr;
     449    psString psSplit;
     450    psStr = psStringCopy(str);
     451    psSplit = psStringCopy(split);
     452
     453    //Return NULL for NULL inputs
     454    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
     455    strList = psStringSplit(NULL, NULL);
     456    if (strList != NULL) {
     457        psFree(strList);
     458    }
     459    //Return NULL for NULL string input
     460    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
     461    strList = psStringSplit(NULL, split);
     462    if (strList != NULL) {
     463        psFree(strList);
     464    }
     465    //Return NULL for NULL splitter input
     466    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
     467    strList = psStringSplit(str, NULL);
     468    if (strList != NULL) {
     469        psFree(strList);
     470    }
     471
     472
     473    /*
     474        strList = psStringSplit(str, split);
     475     
     476        strList = psStringSplit(psStr, split);
     477     
     478        strList = psStringSplit(str, psSplit);
     479     
     480        strList = psStringSplit(psStr, psSplit);
     481    */
     482    //    psFree(strList);
     483    return 0;
     484}
     485
Note: See TracChangeset for help on using the changeset viewer.