Changeset 988
- Timestamp:
- Jun 10, 2004, 1:14:22 PM (22 years ago)
- Location:
- trunk/psLib/test/collections
- Files:
-
- 1 added
- 5 edited
-
tst_psSort_01.c (modified) (4 diffs)
-
tst_psSort_04.c (modified) (3 diffs)
-
verified/tst_psSort_01.stderr (added)
-
verified/tst_psSort_01.stdout (modified) (2 diffs)
-
verified/tst_psSort_04.stderr (modified) (1 diff)
-
verified/tst_psSort_04.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/collections/tst_psSort_01.c
r831 r988 10 10 * @author Ross Harman, MHPCC 11 11 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-06- 02 23:29:29$12 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-06-10 23:14:22 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 25 25 psVector *in = NULL; 26 26 psVector *out = NULL; 27 psVector *tempVec = NULL; 27 28 28 29 29 30 // Test A - Create float vectors 30 31 printPositiveTestHeader(stdout,"psSort", "Create float vectors"); 31 in = psVectorAlloc( 5, PS_TYPE_F32);32 in->n = 5;33 out = psVectorAlloc( 5, PS_TYPE_F32);34 out->n = 5;32 in = psVectorAlloc(7, PS_TYPE_F32); 33 in->n = 7; 34 out = psVectorAlloc(7, PS_TYPE_F32); 35 out->n = 7; 35 36 in->data.F32[0] = 7.0f; 36 37 in->data.F32[1] = 9.0f; … … 38 39 in->data.F32[3] = 1.0f; 39 40 in->data.F32[4] = 5.0f; 40 for(int i=0; i<5; i++) { 41 in->data.F32[5] = 5.0f; 42 in->data.F32[6] = -20.0f; 43 for(int i=0; i<7; i++) { 41 44 printf("vec[%d] = %f\n", i, in->data.F32[i]); 42 45 } … … 46 49 // Test B - Sort input float vector and put results into output float vector 47 50 printPositiveTestHeader(stdout,"psSort", "Sort float vector"); 51 tempVec = out; 48 52 out = psSort(out, in); 49 for(int i=0; i< 5; i++) {53 for(int i=0; i<7; i++) { 50 54 printf("vec[%d] = %f\n", i, out->data.F32[i]); 55 } 56 if(out != tempVec) { 57 printf("Error: Return pointer not equal to output argument pointer\n"); 51 58 } 52 59 printFooter(stdout, "psSort", "Sort float vector", true); 53 60 54 61 55 // Test C - Free float vectors 62 // Test C - Sort input float vector into itself 63 printPositiveTestHeader(stdout,"psSort", "Sort input float vector into itself"); 64 in = psSort(in, in); 65 for(int i=0; i<7; i++) { 66 printf("vec[%d] = %f\n", i, out->data.F32[i]); 67 } 68 printFooter(stdout, "psSort", "Sort input float vector into itself", true); 69 70 71 // Test D - Free float vectors 56 72 printPositiveTestHeader(stdout,"psSort", "Free float vectors"); 57 73 psVectorFree(in); -
trunk/psLib/test/collections/tst_psSort_04.c
r831 r988 5 5 * This test driver contains the following tests for psSort test point 4: 6 6 * A) Attempt to sort with null input vector 7 * B) Attempt to sort with null output vector 8 * C) Free vectors 7 * B) Free vectors 9 8 * 10 9 * @author Ross Harman, MHPCC 11 10 * 12 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-06- 02 23:29:29$11 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-06-10 23:14:22 $ 14 13 * 15 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 23 { 25 24 psVector *badIn = NULL; 26 psVector *badOut = NULL;27 psVector *goodIn = psVectorAlloc(5, PS_TYPE_F32);28 25 psVector *goodOut = psVectorAlloc(5, PS_TYPE_F32); 29 26 … … 34 31 printFooter(stdout, "psSort", "Attempt to sort with null input vector", true); 35 32 36 // Test B - Attempt to sort with null output vector 37 printNegativeTestHeader(stdout,"psSort", "Attempt to sort with null output vector", 38 "Null output vector", 0); 39 badOut = psSort(badOut, goodIn); 40 printFooter(stdout, "psSort", "Attempt to sort with null output vector", true); 41 42 // Test C - Free vectors 33 // Test B - Free vectors 43 34 printPositiveTestHeader(stdout, "psSort", "Free vectors"); 44 psVectorFree(goodIn);45 35 psVectorFree(goodOut); 46 36 psMemCheckLeaks(0, NULL, stdout); -
trunk/psLib/test/collections/verified/tst_psSort_01.stdout
r805 r988 10 10 vec[3] = 1.000000 11 11 vec[4] = 5.000000 12 vec[5] = 5.000000 13 vec[6] = -20.000000 12 14 13 15 ---> TESTPOINT PASSED (psSort{Create float vectors} | tst_psSort_01.c) … … 19 21 \----------------------------------------------------------------------------------/ 20 22 21 vec[0] = 1.000000 22 vec[1] = 3.000000 23 vec[2] = 5.000000 24 vec[3] = 7.000000 25 vec[4] = 9.000000 23 vec[0] = -20.000000 24 vec[1] = 1.000000 25 vec[2] = 3.000000 26 vec[3] = 5.000000 27 vec[4] = 5.000000 28 vec[5] = 7.000000 29 vec[6] = 9.000000 26 30 27 31 ---> TESTPOINT PASSED (psSort{Sort float vector} | tst_psSort_01.c) 32 33 /----------------------------- TESTPOINT ------------------------------------------\ 34 | TestFile: tst_psSort_01.c | 35 | TestPoint: psSort{Sort input float vector into itself} | 36 | TestType: Positive | 37 \----------------------------------------------------------------------------------/ 38 39 vec[0] = -20.000000 40 vec[1] = 1.000000 41 vec[2] = 3.000000 42 vec[3] = 5.000000 43 vec[4] = 5.000000 44 vec[5] = 7.000000 45 vec[6] = 9.000000 46 47 ---> TESTPOINT PASSED (psSort{Sort input float vector into itself} | tst_psSort_01.c) 28 48 29 49 /----------------------------- TESTPOINT ------------------------------------------\ -
trunk/psLib/test/collections/verified/tst_psSort_04.stderr
r805 r988 1 <DATE> <TIME> <HOST> |E|psSort | : Line 124 - Null input vector 2 <DATE> <TIME> <HOST> |E|psSort | : Line 119 - Null output vector 1 <DATE> <TIME> <HOST> |E|psSort | : Line 118 - Null input vector -
trunk/psLib/test/collections/verified/tst_psSort_04.stdout
r805 r988 12 12 /----------------------------- TESTPOINT ------------------------------------------\ 13 13 | TestFile: tst_psSort_04.c | 14 | TestPoint: psSort{Attempt to sort with null output vector} |15 | TestType: Negative |16 | ExpectedErrorText: Null output vector |17 | ExpectedStatusValue: 0 |18 \----------------------------------------------------------------------------------/19 20 21 ---> TESTPOINT PASSED (psSort{Attempt to sort with null output vector} | tst_psSort_04.c)22 23 /----------------------------- TESTPOINT ------------------------------------------\24 | TestFile: tst_psSort_04.c |25 14 | TestPoint: psSort{Free vectors} | 26 15 | TestType: Positive |
Note:
See TracChangeset
for help on using the changeset viewer.
