Changeset 1304
- Timestamp:
- Jul 27, 2004, 2:05:32 PM (22 years ago)
- Location:
- trunk/psLib/test/collections
- Files:
-
- 2 added
- 1 edited
-
tst_psVectorSort_02.c (modified) (3 diffs)
-
verified/tst_psVectorSort_02.stderr (added)
-
verified/tst_psVectorSort_02.stdout (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psVectorSort_02.c
r1233 r1304 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-07- 15 23:52:34$12 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-07-28 00:05:19 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 29 29 // Test A - Create float vectors 30 printPositiveTestHeader(stdout,"psVectorSort ", "Create vectors");30 printPositiveTestHeader(stdout,"psVectorSortIndex", "Create vectors"); 31 31 in = psVectorAlloc(5, PS_TYPE_F32); 32 32 in->n = 5; 33 out = psVectorAlloc(5, PS_TYPE_F32);34 out->n = 5;35 33 in->data.F32[0] = 7.0f; 36 34 in->data.F32[1] = 9.0f; … … 41 39 printf("arr[%d] = %f\n", i, in->data.F32[i]); 42 40 } 43 printFooter(stdout, "psVectorSort ", "Create vectors", true);41 printFooter(stdout, "psVectorSortIndex", "Create vectors", true); 44 42 45 43 46 44 // Test B - Sort integer vector of indices based on pre-sort order of floating point vector 47 printPositiveTestHeader(stdout,"psVectorSort ", "Create sorted index vector");45 printPositiveTestHeader(stdout,"psVectorSortIndex", "Create sorted index vector"); 48 46 out = psVectorSortIndex(out, in); 49 47 for(int i=0; i<5; i++) { 50 printf("arr[%d] = %d\n", i, out->data. S32[i]);48 printf("arr[%d] = %d\n", i, out->data.U32[i]); 51 49 } 52 printFooter(stdout, "psVectorSort ", "Create sorted index vector", true);50 printFooter(stdout, "psVectorSortIndex", "Create sorted index vector", true); 53 51 52 // Test D - Verify the output vector is of type psU32 53 printPositiveTestHeader(stdout,"psVectorSortIndex", "Verify output vector type"); 54 if(out->type.type != PS_TYPE_U32) { 55 printf("ERROR: output vector is of type %d\n", out->type.type); 56 } 57 printFooter(stdout, "psVectorSortIndex", "Verify output vector type", true); 54 58 55 59 // Test C - Free vectors 56 printPositiveTestHeader(stdout,"psVectorSort ", "Free vectors");60 printPositiveTestHeader(stdout,"psVectorSortIndex", "Free vectors"); 57 61 psFree(in); 58 62 psFree(out); 59 psMemCheckLeaks(0, NULL, stdout); 63 int nLeaks = psMemCheckLeaks(0, NULL, stdout); 64 if(nLeaks) { 65 printf("ERROR: Found %d memory leaks\n", nLeaks); 66 } 60 67 int nBad = psMemCheckCorruption(0); 61 68 if(nBad) {
Note:
See TracChangeset
for help on using the changeset viewer.
