Changeset 23259 for trunk/psLib/test/math/tst_psRandom.c
- Timestamp:
- Mar 10, 2009, 4:53:42 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/math/tst_psRandom.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/math/tst_psRandom.c
r6484 r23259 3 3 work properly. 4 4 5 t00(): ensure that psRandom structs are properly allocated by psRandomAlloc ().5 t00(): ensure that psRandom structs are properly allocated by psRandomAllocSpecific(). 6 6 t01(): ensure that psRandomUniform() produces a sequence of numbers with 7 7 proper mean and stdev. … … 45 45 46 46 testDescription tests[] = { 47 {testRandomAlloc,000,"psRandomAlloc ",0,false},47 {testRandomAlloc,000,"psRandomAllocSpecific",0,false}, 48 48 {testRandomUniform,000,"psRandomUniform",0,false}, 49 49 {testRandomGaussian,000,"psRandomGaussian",0,false}, … … 70 70 71 71 // Valid type allocation 72 myRNG = psRandomAlloc (PS_RANDOM_TAUS, SEED);72 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 73 73 if (myRNG == NULL) { 74 74 psError(PS_ERR_UNKNOWN,true,"Could not allocate psRandom structure"); … … 85 85 // psLogSetDestination("file:seed_msglog1.txt"); 86 86 psLogSetDestination(fd1); 87 myRNG = psRandomAlloc (PS_RANDOM_TAUS, 0);87 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, 0); 88 88 // psLogSetDestination("dest:stderr"); 89 89 psLogSetDestination(2); … … 100 100 // Invalid type allocation 101 101 psLogMsg(__func__,PS_LOG_INFO,"Invalid type, should generate error message"); 102 myRNG = psRandomAlloc (100,SEED);102 myRNG = psRandomAllocSpecific(100,SEED); 103 103 if (myRNG != NULL) { 104 104 psError(PS_ERR_UNKNOWN,true,"Did not return NULL for invalid type"); … … 107 107 108 108 // Negative seed value 109 myRNG = psRandomAlloc (PS_RANDOM_TAUS,-5);109 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS,-5); 110 110 if(myRNG == NULL) { 111 111 psError(PS_ERR_UNKNOWN,true,"Did not return allocated psRandom"); … … 125 125 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 126 126 127 myRNG = psRandomAlloc (PS_RANDOM_TAUS, SEED);127 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 128 128 if (myRNG == NULL) { 129 129 psError(PS_ERR_UNKNOWN,true,"Could not allocate psRandom structure"); … … 171 171 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 172 172 173 myRNG = psRandomAlloc (PS_RANDOM_TAUS, SEED);173 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 174 174 if (myRNG == NULL) { 175 175 psError(PS_ERR_UNKNOWN,true,"Could not allocate psRandom structure"); … … 219 219 psStats *stats = psStatsAlloc(PS_STAT_SAMPLE_MEAN); 220 220 221 myRNG = psRandomAlloc (PS_RANDOM_TAUS, SEED);221 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 222 222 if (myRNG == NULL) { 223 223 psError(PS_ERR_UNKNOWN,true,"Could not allocate psRandom structure"); … … 268 268 rans02->n = rans02->nalloc; 269 269 270 myRNG = psRandomAlloc (PS_RANDOM_TAUS, SEED);270 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 271 271 if (myRNG == NULL) { 272 272 psError(PS_ERR_UNKNOWN,true,"Could not allocate psRandom structure"); … … 302 302 303 303 psRandom *myRNG1 = NULL; 304 myRNG1 = psRandomAlloc (PS_RANDOM_TAUS, SEED);304 myRNG1 = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 305 305 // psLogSetDestination("dest:stderr"); 306 306 psLogSetDestination(0); … … 326 326 rans02->n = rans02->nalloc; 327 327 328 myRNG = psRandomAlloc (PS_RANDOM_TAUS, SEED);328 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 329 329 if (myRNG == NULL) { 330 330 psError(PS_ERR_UNKNOWN,true,"Could not allocate psRandom structure"); … … 372 372 rans02->n = rans02->nalloc; 373 373 374 myRNG = psRandomAlloc (PS_RANDOM_TAUS, SEED);374 myRNG = psRandomAllocSpecific(PS_RANDOM_TAUS, SEED); 375 375 if (myRNG == NULL) { 376 376 psError(PS_ERR_UNKNOWN,true,"Could not allocate psRandom structure");
Note:
See TracChangeset
for help on using the changeset viewer.
