Changeset 8234
- Timestamp:
- Aug 8, 2006, 2:06:26 PM (20 years ago)
- Location:
- trunk/psLib
- Files:
-
- 1 added
- 4 edited
-
src/pstap.h (added)
-
test/sys/tap_psStringSubstitute.c (modified) (7 diffs)
-
test/types/Makefile.am (modified) (2 diffs)
-
test/types/tap_psMetadataItemCompare.c (modified) (1 diff)
-
test/types/tst_psMetadata_01.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tap_psStringSubstitute.c
r8224 r8234 29 29 ok(input && strcmp(input, ORIGINAL) == 0, "output = %s", input); 30 30 // psFree(input); 31 ok(psMemCheckLeaks(0, NULL, stdout, false) == 0, "Memory Leaks"); 31 // ok(psMemCheckLeaks(0, NULL, stdout, false) == 0, "Memory Leaks"); 32 mem(); 32 33 } 33 34 … … 38 39 ok(output && strcmp(output, CORRECTED) == 0, "output = %s", output); 39 40 psFree(output); 41 mem(); 40 42 } 41 43 … … 46 48 ok(output && strcmp(output, CORRECTED) == 0, "output = %s", output); 47 49 psFree(output); 50 mem(); 48 51 } 49 52 … … 52 55 psString output = psStringSubstitute(NULL, "XXX", ","); 53 56 ok(!output, "output = %s", output); 57 mem(); 54 58 } 55 59 … … 60 64 ok(output && strcmp(output, input) == 0, "output = %s", output); 61 65 psFree(output); 66 mem(); 62 67 } 63 68 … … 68 73 ok(output && strcmp(output, "This is! a! test case! to check.") == 0, "output = %s", output); 69 74 psFree(output); 75 mem(); 70 76 } 71 77 … … 78 84 "output = %s", output); 79 85 psFree(output); 86 mem(); 80 87 } 81 88 -
trunk/psLib/test/types/Makefile.am
r7998 r8234 29 29 tap_psMetadataIterator \ 30 30 tap_psListIterator \ 31 tap_psMetadataConfigParse 31 tap_psMetadataConfigParse \ 32 tap_psMetadataItemCompare 32 33 33 34 … … 61 62 tap_psMetadataConfigParse_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test/tap/src 62 63 tap_psMetadataConfigParse_LDFLAGS = $(AM_LDFLAGS) $(top_builddir)/test/tap/src/libtap.la 64 65 tap_psMetadataItemCompare_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test/tap/src 66 tap_psMetadataItemCompare_LDFLAGS = $(AM_LDFLAGS) $(top_builddir)/test/tap/src/libtap.la 63 67 64 68 check_DATA = \ -
trunk/psLib/test/types/tap_psMetadataItemCompare.c
r8225 r8234 1 1 #include <stdio.h> 2 #include <pslib.h> 3 #include "tap.h" 2 #include "pstap.h" 4 3 5 4 int main (void) 6 5 { 7 plan_tests(8); 6 psMetadataItem *compare = NULL; 7 psMetadataItem *template = NULL; 8 psMetadataItem *itemCopy = NULL; 9 psMetadataItem *item = psMetadataItemAlloc("Snickers", PS_DATA_BOOL, "No Comment", true) 10 ; 11 plan_tests(7); 8 12 9 13 diag("psMetadataItemCompare() tests"); 10 14 11 // Return input for NULL key15 //Return false for NULL compare psMetadataItem 12 16 { 13 psString input = psStringCopy(ORIGINAL); 14 psString output = psStringSubstitute(input, ",", NULL); 15 ok(output && strcmp(output, ORIGINAL) == 0, "output = %s", output); 16 psFree(output); 17 ok( !psMetadataItemCompare(compare, item), 18 "return false for NULL compare input." ); 17 19 } 18 20 21 //Return false for NULL template psMetadataItem 22 { 23 ok( !psMetadataItemCompare(item, template), 24 "return false for NULL template input." ) 25 ; 26 } 19 27 28 template = psMetadataItemAlloc("Milky Way", PS_DATA_BOOL, "No Comment", true) 29 ; 30 compare = psMetadataItemAlloc("Snickers", PS_DATA_S32, "No Comment", 1); 20 31 32 //Return false for psMetadataItem's with different names 33 { 34 ok( !psMetadataItemCompare(template, item), 35 "return false for input with different names." ) 36 ; 37 } 21 38 39 //Return true for psMetadataItem's with different types but otherwise identical 40 { 41 ok( psMetadataItemCompare(compare, item), 42 "return true for valid compare of different type." ); 43 } 22 44 45 //Return false for comparing Bool with F32 46 psFree(compare); 47 compare = psMetadataItemAlloc("Snickers", PS_DATA_F64, "No Comment", 1.0000); 48 { 49 ok( !psMetadataItemCompare(compare, item), 50 "return false for comparison of F64 to bool." ); 51 } 23 52 53 //Return true for comparing S32 with F32 of same value 54 psFree(template) 55 ; 56 template = psMetadataItemAlloc("Snickers", PS_DATA_S32, "No Comment", 1) 57 ; 58 psFree(compare); 59 compare = psMetadataItemAlloc("Snickers", PS_DATA_F32, "No Comment", 1.00); 60 { 61 ok( psMetadataItemCompare(compare, template), 62 "return true for comparison of S32 to F32." ) 63 ; 64 } 24 65 66 //Check for Memory Leaks before exit 67 { 68 psFree(compare); 69 psFree(template) 70 ; 71 psFree(itemCopy); 72 psFree(item); 73 } 25 74 26 27 28 return exit_status(); 75 // return exit_status(); 76 done(); 29 77 } 30 78 -
trunk/psLib/test/types/tst_psMetadata_01.c
r8224 r8234 5 5 * @author dRob, MHPCC 6 6 * 7 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-08-0 8 01:27:45$7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-08-09 00:06:26 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 20 20 static psS32 testMetadataPrint(void); 21 21 static psS32 testMetadataItemCompare(void); 22 static psS32 testMetadataItemParse(void); 22 23 23 24 testDescription tests[] = { … … 26 27 {testMetadataPrint,667,"psMetadataPrint",0,false}, 27 28 {testMetadataItemCompare,669,"psMetadataItemCompare",0,false}, 29 {testMetadataItemParse,665,"psMetadataItemParse",0,false}, 28 30 {NULL} 29 31 }; … … 289 291 } 290 292 293 psS32 testMetadataItemParse(void) 294 { 295 296 return 0; 297 } 298 299
Note:
See TracChangeset
for help on using the changeset viewer.
