Changeset 688 for trunk/psLib/test/collections/tst_psSort_03.c
- Timestamp:
- May 14, 2004, 11:04:23 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/collections/tst_psSort_03.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psSort_03.c
r620 r688 4 4 * 5 5 * This test driver contains the following tests for psSort test point 3: 6 * A) Create float arrays of different sizes7 * B) Attempt to sort arrays...should get errors8 * C) Free float arrays6 * A) Create float vectors of different sizes 7 * B) Attempt to sort vectors...should get errors 8 * C) Free float vectors 9 9 * 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-05- 08 01:19:28$12 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-05-14 21:04:23 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 23 23 char* argv[]) 24 24 { 25 ps Array*in = NULL;26 ps Array*out = NULL;25 psVector *in = NULL; 26 psVector *out = NULL; 27 27 28 28 29 // Test A - Create float arrays30 printPositiveTestHeader(stdout,"psSort", "Create float arrays of different sizes");31 in = ps FloatArrayAlloc(5);29 // Test A - Create float vectors 30 printPositiveTestHeader(stdout,"psSort", "Create float vectors of different sizes"); 31 in = psVectorAlloc(PS_TYPE_FLOAT, 5); 32 32 in->n = 5; 33 out = ps FloatArrayAlloc(6);33 out = psVectorAlloc(PS_TYPE_FLOAT, 6); 34 34 out->n = 6; 35 35 in->n = 5; 36 36 for(int i=0; i<5; i++) { 37 printf("arr[%d] = %f\n", i, in-> arr.fltArr[i]);37 printf("arr[%d] = %f\n", i, in->vec.f[i]); 38 38 } 39 printFooter(stdout, "psSort", "Create float arrays of different sizes", true);39 printFooter(stdout, "psSort", "Create float vectors of different sizes", true); 40 40 41 41 42 // Test B - Sort input float array and put results into output float array43 printNegativeTestHeader(stdout,"psSort", "Sort float array",44 "Input and output arraysizes are not equal", 0);42 // Test B - Sort input float vector and put results into output float vector 43 printNegativeTestHeader(stdout,"psSort", "Sort float vector", 44 "Input and output vector sizes are not equal", 0); 45 45 out = psSort(out, in); 46 printFooter(stdout, "psSort", "Sort float array", true);46 printFooter(stdout, "psSort", "Sort float vector", true); 47 47 48 48 49 // Test C - Free float arrays50 printPositiveTestHeader(stdout,"psSort", "Free float arrays");51 ps FloatArrayFree(in);52 ps FloatArrayFree(out);49 // Test C - Free float vectors 50 printPositiveTestHeader(stdout,"psSort", "Free float vectors"); 51 psVectorFree(in); 52 psVectorFree(out); 53 53 psMemCheckLeaks(0, NULL, stdout); 54 54 int nBad = psMemCheckCorruption(0); … … 56 56 printf("ERROR: Found %d bad memory blocks\n", nBad); 57 57 } 58 printFooter(stdout, "psSort", "Free float arrays", true);58 printFooter(stdout, "psSort", "Free float vectors", true); 59 59 60 60 }
Note:
See TracChangeset
for help on using the changeset viewer.
