The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches
 TEST_CASE ("setInputErrorHandler", TEST_CATEGORY)
 
 TEST_CASE ("setMaxNumReportedSigFigs", TEST_CATEGORY)
 
 TEST_CASE ("setNumReportedNewlines", TEST_CATEGORY)
 
 TEST_CASE ("setSeeds", TEST_CATEGORY)
 
 TEST_CASE ("setSeedsToDefault", TEST_CATEGORY)
 
 TEST_CASE ("getSeeds", TEST_CATEGORY)
 
 TEST_CASE ("getNumSeeds", TEST_CATEGORY)
 
 TEST_CASE ("setValidationOn", TEST_CATEGORY)
 
 TEST_CASE ("setValidationOff", TEST_CATEGORY)
 
 TEST_CASE ("setValidationEpsilon", TEST_CATEGORY)
 
 TEST_CASE ("getValidationEpsilon", TEST_CATEGORY)
 
 TEST_CASE ("setValidationEpsilonToDefault", TEST_CATEGORY)
 
 TEST_CASE ("getGpuCacheSize", TEST_CATEGORY)
 

Detailed Description

Function Documentation

◆ TEST_CASE() [1/13]

TEST_CASE ( "getGpuCacheSize" ,
TEST_CATEGORY  )

Definition at line 681 of file debug.cpp.

681 {
682
683 SECTION( LABEL_CORRECTNESS ) {
684
685 // confirm cache begins empty
687 REQUIRE( getGpuCacheSize() == 0 );
688
689 // hackily detect cuQuantum
690 char envStr[200];
691 getEnvironmentString(envStr);
692 bool usingCuQuantum = std::string(envStr).find("cuQuantum=0") == std::string::npos;
693
694 // proceed only if we're ever using our own GPU cache
695 if (getQuESTEnv().isGpuAccelerated && !usingCuQuantum) {
696
697 // GPU cache created for >= 6 qubit matrices
698 Qureg qureg = createCustomQureg(10, 0, 0,1,0); // gpu only
699 CompMatr matr = createCompMatr(6); // always in gpu
700 for (qindex i=0; i<matr.numRows; i++)
701 matr.cpuElems[i][i] = 1;
702 syncCompMatr(matr);
703
704 // each control qubit halves the necessary cache size;
705 // so we start with many controls and remove each in-turn,
706 // expanding the GPU cache in every call
707 int targs[] = {0,1,2,3,4,5};
708 int ctrls[] = {6,7,8,9};
709 qindex cacheSize = 0;
710
711 for (int numCtrls=4; numCtrls>=0; numCtrls--) {
712
713 // expand the cache
714 applyMultiControlledCompMatr(qureg, ctrls, numCtrls, targs, 6, matr);
715
716 // confirm it expanded, OR stayed the same, which happens when
717 // the total number of simultaneous threads needed hits/exceeds
718 // the number available in the hardware
719 qindex newSize = getGpuCacheSize();
720 CAPTURE( cacheSize, newSize );
721 REQUIRE( newSize >= cacheSize );
722
723 cacheSize = newSize;
724 }
725
726 destroyQureg(qureg);
727 destroyCompMatr(matr);
728 }
729 }
730
731 SECTION( LABEL_VALIDATION ) {
732
733 // performs no validation
734 SUCCEED( );
735 }
736}
qindex getGpuCacheSize()
Definition debug.cpp:164
void clearGpuCache()
Definition debug.cpp:175
void getEnvironmentString(char str[200])
QuESTEnv getQuESTEnv()
CompMatr createCompMatr(int numQubits)
Definition matrices.cpp:211
void destroyCompMatr(CompMatr matrix)
Definition matrices.cpp:402
void syncCompMatr(CompMatr matr)
Definition matrices.cpp:377
void applyMultiControlledCompMatr(Qureg qureg, int *controls, int numControls, int *targets, int numTargets, CompMatr matr)
Qureg createCustomQureg(int numQubits, int isDensMatr, int useDistrib, int useGpuAccel, int useMultithread)
Definition qureg.cpp:273
void destroyQureg(Qureg qureg)
Definition qureg.cpp:330
Definition qureg.h:49

◆ TEST_CASE() [2/13]

TEST_CASE ( "getNumSeeds" ,
TEST_CATEGORY  )

Definition at line 346 of file debug.cpp.

346 {
347
348 SECTION( LABEL_CORRECTNESS ) {
349
350 SECTION( "can be called immediately" ) {
351
352 REQUIRE_NOTHROW( getNumSeeds() );
353 }
354
355 SECTION( "correct output" ) {
356
357 GENERATE( range(0,10) );
358
359 // prepare random seeds (using test utils RNG, not QuEST's)
360 int numSeeds = getRandomInt(1, 10);
361 vector<unsigned> in(numSeeds);
362 for (int i=0; i<numSeeds; i++)
363 in[i] = static_cast<unsigned>(getRandomInt(0, 99999));
364
365 // pass seeds to QuEST
366 setSeeds(in.data(), numSeeds);
367
368 // confirm we get out correct number
369 REQUIRE( getNumSeeds() == numSeeds );
370 }
371 }
372
373 SECTION( LABEL_VALIDATION ) {
374
375 SECTION( "env not initialised" ) {
376
377 // no way to test this
378 SUCCEED( );
379 }
380 }
381
382 // re-randomise seeds for remaining tests
384}
void setSeedsToDefault()
Definition debug.cpp:45
int getNumSeeds()
Definition debug.cpp:52
void setSeeds(unsigned *seeds, int numSeeds)
Definition debug.cpp:37
int getRandomInt(int min, int maxExcl)
Definition random.cpp:90

◆ TEST_CASE() [3/13]

TEST_CASE ( "getSeeds" ,
TEST_CATEGORY  )

Definition at line 297 of file debug.cpp.

297 {
298
299 SECTION( LABEL_CORRECTNESS ) {
300
301 SECTION( "can be called immediately" ) {
302
303 REQUIRE_NOTHROW( getNumSeeds() );
304
305 int numSeeds = getNumSeeds();
306 vector<unsigned> out(numSeeds);
307
308 REQUIRE_NOTHROW( getSeeds(out.data()) );
309 }
310
311 SECTION( "correct output" ) {
312
313 GENERATE( range(0,10) );
314
315 // prepare random seeds (using test utils RNG, not QuEST's)
316 int numSeeds = getRandomInt(1, 10);
317 vector<unsigned> in(numSeeds);
318 for (int i=0; i<numSeeds; i++)
319 in[i] = static_cast<unsigned>(getRandomInt(0, 99999));
320
321 // pass seeds to QuEST
322 setSeeds(in.data(), numSeeds);
323
324 // check we get them back
325 vector<unsigned> out(numSeeds);
326 getSeeds(out.data());
327 for (int i=0; i<numSeeds; i++)
328 REQUIRE( in[i] == out[i] );
329 }
330 }
331
332 SECTION( LABEL_VALIDATION ) {
333
334 SECTION( "env not initialised" ) {
335
336 // no way to test this
337 SUCCEED( );
338 }
339 }
340
341 // re-randomise seeds for remaining tests
343}
std::vector< unsigned > getSeeds()
Definition debug.cpp:197

◆ TEST_CASE() [4/13]

TEST_CASE ( "getValidationEpsilon" ,
TEST_CATEGORY  )

Definition at line 551 of file debug.cpp.

551 {
552
553 SECTION( LABEL_CORRECTNESS ) {
554
555 // confirm always safe to call
556 for (int i=0; i<3; i++)
557 REQUIRE_NOTHROW( getValidationEpsilon() ); // ignores output
558
559 GENERATE( range(0,10) );
560
561 // confirm set correctly
562 qreal eps = getRandomReal(0, 99999);
564
565 REQUIRE( getValidationEpsilon() == eps );
566 }
567
568 SECTION( LABEL_VALIDATION ) {
569
570 // has no validation
571 SUCCEED( );
572 }
573
574 // ensure validation epsilon is default for remaining tests
576}
void setValidationEpsilonToDefault()
Definition debug.cpp:108
qreal getValidationEpsilon()
Definition debug.cpp:115
void setValidationEpsilon(qreal eps)
Definition debug.cpp:100
qreal getRandomReal(qreal min, qreal maxExcl)
Definition random.cpp:63

◆ TEST_CASE() [5/13]

TEST_CASE ( "setInputErrorHandler" ,
TEST_CATEGORY  )

TESTS

Definition at line 49 of file debug.cpp.

49 {
50
51 /// @todo
52 /// We can test this by saving the current handler,
53 /// overwriting it to local handlers of our choosing
54 /// and verifying e.g. their error messages are detected,
55 /// then restoring the original handler. Alas, this
56 /// requires exposing the handler in main, else adding
57 /// a quest function for obtaining the user-set handler.
58 /// Both are annoying - I forego them presently! This
59 /// function has anyway been manually tested via examples.
60
61 SUCCEED( );
62}

◆ TEST_CASE() [6/13]

TEST_CASE ( "setMaxNumReportedSigFigs" ,
TEST_CATEGORY  )

Definition at line 65 of file debug.cpp.

65 {
66
67 SECTION( LABEL_CORRECTNESS ) {
68
69 qcomp scalar = getQcomp(0.12345, 0.12345);
70
71 vector<std::string> refs = {
72 "0.1+0.1i",
73 "0.12+0.12i",
74 "0.123+0.123i",
75 "0.1235+0.1235i", // rounded
76 "0.12345+0.12345i"
77 };
78
79 // disable auto \n after lines
81
82 for (size_t numSigFigs=1; numSigFigs<=refs.size(); numSigFigs++) {
83
84 setMaxNumReportedSigFigs(numSigFigs);
85
86 // redirect stdout to buffer
87 std::stringstream buffer;
88 std::streambuf * old = std::cout.rdbuf(buffer.rdbuf());
89 reportScalar("", scalar);
90 std::cout.rdbuf(old);
91 std::string out = buffer.str();
92
93 std::string ref = refs[numSigFigs-1];
94
95 CAPTURE( numSigFigs, ref );
96 REQUIRE( out == ref );
97 }
98 }
99
100 SECTION( LABEL_VALIDATION ) {
101
102 SECTION( "number" ) {
103
104 int num = GENERATE( -1, 0 );
105
106 REQUIRE_THROWS_WITH( setMaxNumReportedSigFigs(num), ContainsSubstring("Cannot be less than one") );
107 }
108 }
109
110 // restore to QuEST default for future tests
112}
void setMaxNumReportedSigFigs(int numSigFigs)
Definition debug.cpp:142
void setNumReportedNewlines(int numNewlines)
Definition debug.cpp:150
static qcomp getQcomp(qreal re, qreal im)
Definition types.h:91
void reportScalar(const char *label, qcomp num)
Definition types.cpp:51

◆ TEST_CASE() [7/13]

TEST_CASE ( "setNumReportedNewlines" ,
TEST_CATEGORY  )

Definition at line 115 of file debug.cpp.

115 {
116
117 SECTION( LABEL_CORRECTNESS ) {
118
119 for (int numNewlines=0; numNewlines<3; numNewlines++) {
120
121 setNumReportedNewlines(numNewlines);
122
123 // redirect stdout to buffer
124 std::stringstream buffer;
125 std::streambuf * old = std::cout.rdbuf(buffer.rdbuf());
126 reportStr("x");
127 std::cout.rdbuf(old);
128 std::string out = buffer.str();
129
130 std::string ref = "x" + std::string(numNewlines, '\n');
131
132 CAPTURE( numNewlines, ref );
133 REQUIRE( out == ref );
134 }
135 }
136
137 SECTION( LABEL_VALIDATION ) {
138
139 SECTION( "number" ) {
140
141 REQUIRE_THROWS_WITH( setNumReportedNewlines(-1), ContainsSubstring("Cannot generally be less than zero") );
142 }
143
144 SECTION( "multine number" ) {
145
147
148 REQUIRE_THROWS_WITH( reportQuESTEnv(), ContainsSubstring("zero") && ContainsSubstring("not permitted when calling multi-line") );
149 }
150 }
151
152 // restore to QuEST default for future tests
154}
void reportQuESTEnv()
void reportStr(const char *str)
Definition types.cpp:29

◆ TEST_CASE() [8/13]

TEST_CASE ( "setSeeds" ,
TEST_CATEGORY  )

Definition at line 157 of file debug.cpp.

157 {
158
159 SECTION( LABEL_CORRECTNESS ) {
160
161 // perform the below test for every combination
162 // of deployments, since their RNGs differ
163
164 for (auto& [label, qureg]: getCachedDensmatrs()) {
165
166 DYNAMIC_SECTION( label ) {
167
168 SECTION( "same seed consistency" ) {
169
170 unsigned seeds[] = {123, 543, 755};
171 const int numSeeds = 3;
172 const int numMixedStates = 10;
173 const int numReps = 5;
174
175 // set an arbitrary fixed seed...
176 setSeeds(seeds, numSeeds);
177
178 // generate and remember a random state
179 initRandomMixedState(qureg, numMixedStates);
180 qmatrix ref = getMatrix(qureg);
181
182 // get a set of random measurement outcomes
183 vector<int> outcomes(qureg.numQubits);
184 for (int i=0; i<qureg.numQubits; i++)
185 outcomes[i] = applyQubitMeasurement(qureg, i);
186
187 // repeatedly...
188 for (int r=0; r<numReps; r++) {
189
190 // reset the seed
191 setSeeds(seeds, numSeeds);
192
193 // and confirm all random states are re-produced
194 initRandomMixedState(qureg, numMixedStates);
195 REQUIRE_AGREE( qureg, ref);
196
197 // as are all measurement outcomes
198 for (int i=0; i<qureg.numQubits; i++)
199 REQUIRE( outcomes[i] == applyQubitMeasurement(qureg,i) );
200 }
201 }
202
203 SECTION( "different key inconsistency" ) {
204
205 unsigned seeds[] = {123, 543, 755};
206 const int numSeeds = 3;
207 const int ampInd = 0;
208
209 // set arbitrary seed and collect random-state amp
210 setSeeds(seeds, numSeeds);
211 initRandomPureState(qureg);
212 qcomp amp1 = getDensityQuregAmp(qureg, ampInd, ampInd);
213
214 // change one passed seed and re-collect random-state amp
215 int i = GENERATE_COPY( range(0,numSeeds) );
216 seeds[i] = 987654321;
217 setSeeds(seeds, numSeeds);
218 initRandomPureState(qureg);
219 qcomp amp2 = getDensityQuregAmp(qureg, ampInd, ampInd);
220
221 // amps differ if seed successfully impacts outcomes
222 REQUIRE( amp1 != amp2 );
223 }
224 }
225 }
226 }
227
228 SECTION( LABEL_VALIDATION ) {
229
230 SECTION( "env not initialised" ) {
231
232 // no way to test this
233 SUCCEED( );
234 }
235
236 SECTION( "number of seeds" ) {
237
238 int numSeeds = GENERATE( -1, 0 );
239
240 REQUIRE_THROWS_WITH( setSeeds(nullptr, numSeeds), ContainsSubstring("Invalid number of random seeds") );
241 }
242
243 // inconsistency between nodes is permitted
244 }
245
246 // re-randomise seeds for remaining tests
248}
void initRandomPureState(Qureg qureg)
void initRandomMixedState(Qureg qureg, qindex numPureStates)
int applyQubitMeasurement(Qureg qureg, int target)
qcomp getDensityQuregAmp(Qureg qureg, qindex row, qindex column)
Definition qureg.cpp:497

◆ TEST_CASE() [9/13]

TEST_CASE ( "setSeedsToDefault" ,
TEST_CATEGORY  )

Definition at line 251 of file debug.cpp.

251 {
252
253 SECTION( LABEL_CORRECTNESS ) {
254
255 // perform the below test for every combination
256 // of deployments, since their RNGs differ
257
258 for (auto& [label, qureg]: getCachedDensmatrs()) {
259
260 DYNAMIC_SECTION( label ) {
261
262 SECTION( "different key inconsistency" ) {
263
264 const int ampInd = 0;
265
266 // randomise seed and collect random-state amp
268 initRandomPureState(qureg);
269 qcomp amp1 = getDensityQuregAmp(qureg, ampInd, ampInd);
270
271 // re-randomise seed and collect new random-state amp
273 initRandomPureState(qureg);
274 qcomp amp2 = getDensityQuregAmp(qureg, ampInd, ampInd);
275
276 // amps differ if seed re-randomisation impacts outcomes
277 REQUIRE( amp1 != amp2 );
278 }
279 }
280 }
281 }
282
283 SECTION( LABEL_VALIDATION ) {
284
285 SECTION( "env not initialised" ) {
286
287 // no way to test this
288 SUCCEED( );
289 }
290 }
291
292 // re-randomise seeds for remaining tests
294}

◆ TEST_CASE() [10/13]

TEST_CASE ( "setValidationEpsilon" ,
TEST_CATEGORY  )

Definition at line 440 of file debug.cpp.

440 {
441
442 SECTION( LABEL_CORRECTNESS ) {
443
444 SECTION( "affects validation" ) {
445
446 Qureg qureg = createQureg(5);
447
448 SECTION( "unitarity" ) {
449
450 // prepare non-unitary matrix
451 CompMatr1 m = getCompMatr1({{1,2},{3,4}});
452
453 // confirm it throws non-unitary error
454 REQUIRE_THROWS( applyCompMatr1(qureg, 0, m) );
455
456 // confirm setting = 0 disables epsilon errors...
458 REQUIRE_NOTHROW( applyCompMatr1(qureg, 0, m) );
459
460 // but does not disable absolute errors
461 REQUIRE_THROWS( applyCompMatr1(qureg, -1, m) );
462
463 // confirm non-zero (forgive all) works
464 setValidationEpsilon(9999); // bigger than dist of m*conj(m) from identity squared
465 REQUIRE_NOTHROW( applyCompMatr1(qureg, 0, m) );
466 }
467
468 /// @todo
469 /// to be completely rigorous, we should test
470 /// that unitarity, hermiticity, CPTPness and
471 /// non-zero-ness of all of CompMatr, DiagMatr
472 /// and FullStateDiagMatr are affected! This
473 /// is quite a chore of course
474
475 destroyQureg(qureg);
476 }
477
478 SECTION( "affects struct fields" ) {
479
480 SECTION( "CompMatr" ) {
481
483 *(m.isApproxUnitary) = 1;
484 *(m.isApproxHermitian) = 1;
485
487 REQUIRE( *(m.isApproxUnitary) == -1 );
488 REQUIRE( *(m.isApproxHermitian) == -1 );
489
491 }
492
493 SECTION( "DiagMatr" ) {
494
496 *(m.isApproxUnitary) = 1;
497 *(m.isApproxHermitian) = 0;
498 *(m.isApproxNonZero) = 1;
499
501 REQUIRE( *(m.isApproxUnitary) == -1 );
502 REQUIRE( *(m.isApproxHermitian) == -1 );
503 REQUIRE( *(m.isApproxNonZero) == -1 );
504
506 }
507
508 SECTION( "FullStateDiagMatr" ) {
509
511 *(m.isApproxUnitary) = 1;
512 *(m.isApproxHermitian) = 0;
513 *(m.isApproxNonZero) = 1;
514
516 REQUIRE( *(m.isApproxUnitary) == -1 );
517 REQUIRE( *(m.isApproxHermitian) == -1 );
518 REQUIRE( *(m.isApproxNonZero) == -1 );
519
521 }
522
523 SECTION( "KrausMap" ) {
524
525 KrausMap k = createKrausMap(1, 3);
526 *(k.isApproxCPTP) = 1;
527
529 REQUIRE( *(k.isApproxCPTP) == -1 );
530
532 }
533 }
534 }
535
536 SECTION( LABEL_VALIDATION ) {
537
538 SECTION( "negative epsilon" ) {
539
540 qreal eps = GENERATE( -0.5, -1, -100 );
541
542 REQUIRE_THROWS_WITH( setValidationEpsilon(eps), ContainsSubstring("positive number") );
543 }
544 }
545
546 // ensure validation epsilon is default for remaining tests
548}
KrausMap createKrausMap(int numQubits, int numOperators)
Definition channels.cpp:172
void destroyKrausMap(KrausMap map)
Definition channels.cpp:208
FullStateDiagMatr createFullStateDiagMatr(int numQubits)
Definition matrices.cpp:327
DiagMatr createDiagMatr(int numQubits)
Definition matrices.cpp:246
void destroyDiagMatr(DiagMatr matrix)
Definition matrices.cpp:403
void destroyFullStateDiagMatr(FullStateDiagMatr matrix)
Definition matrices.cpp:404
static CompMatr1 getCompMatr1(qcomp **in)
Definition matrices.h:311
void applyCompMatr1(Qureg qureg, int target, CompMatr1 matrix)
Qureg createQureg(int numQubits)
Definition qureg.cpp:279
int * isApproxNonZero
Definition matrices.h:166

◆ TEST_CASE() [11/13]

TEST_CASE ( "setValidationEpsilonToDefault" ,
TEST_CATEGORY  )

Definition at line 579 of file debug.cpp.

579 {
580
581 SECTION( LABEL_CORRECTNESS ) {
582
583 SECTION( "always safe to call" ) {
584
585 for (int i=0; i<3; i++)
586 REQUIRE_NOTHROW( setValidationEpsilonToDefault() );
587 }
588
589 SECTION( "affects validation" ) {
590
591 // prepare non-unitary matrix
592 CompMatr1 m = getCompMatr1({{1,2},{3,4}});
593 Qureg qureg = createQureg(1);
594
595 // confirm it throws non-unitary error
596 REQUIRE_THROWS( applyCompMatr1(qureg, 0, m) );
597
598 // confirm setting = 0 disables epsilon errors...
600 REQUIRE_NOTHROW( applyCompMatr1(qureg, 0, m) );
601
602 // which returns when stored to default
604 REQUIRE_THROWS( applyCompMatr1(qureg, 0, m) );
605
606 destroyQureg(qureg);
607 }
608
609 SECTION( "affects struct fields" ) {
610
611 SECTION( "CompMatr" ) {
612
614 *(m.isApproxUnitary) = 1;
615 *(m.isApproxHermitian) = 1;
616
618 REQUIRE( *(m.isApproxUnitary) == -1 );
619 REQUIRE( *(m.isApproxHermitian) == -1 );
620
622 }
623
624 SECTION( "DiagMatr" ) {
625
627 *(m.isApproxUnitary) = 1;
628 *(m.isApproxHermitian) = 0;
629 *(m.isApproxNonZero) = 1;
630
632 REQUIRE( *(m.isApproxUnitary) == -1 );
633 REQUIRE( *(m.isApproxHermitian) == -1 );
634 REQUIRE( *(m.isApproxNonZero) == -1 );
635
637 }
638
639 SECTION( "FullStateDiagMatr" ) {
640
642 *(m.isApproxUnitary) = 1;
643 *(m.isApproxHermitian) = 0;
644 *(m.isApproxNonZero) = 1;
645
647 REQUIRE( *(m.isApproxUnitary) == -1 );
648 REQUIRE( *(m.isApproxHermitian) == -1 );
649 REQUIRE( *(m.isApproxNonZero) == -1 );
650
652 }
653
654 SECTION( "KrausMap" ) {
655
656 KrausMap k = createKrausMap(1, 3);
657 *(k.isApproxCPTP) = 1;
658
660 REQUIRE( *(k.isApproxCPTP) == -1 );
661
663 }
664 }
665 }
666
667 SECTION( LABEL_VALIDATION ) {
668
669 SECTION( LABEL_VALIDATION ) {
670
671 // performs no validation
672 SUCCEED( );
673 }
674 }
675
676 // ensure validation epsilon is default for remaining tests
678}

◆ TEST_CASE() [12/13]

TEST_CASE ( "setValidationOff" ,
TEST_CATEGORY  )

Definition at line 407 of file debug.cpp.

407 {
408
409 SECTION( LABEL_CORRECTNESS ) {
410
411 // confirm always safe to call
412 for (int i=0; i<3; i++)
413 REQUIRE_NOTHROW( setValidationOff() );
414
415 // prepare non-unitary matrix
416 CompMatr1 m = getCompMatr1({{1,2},{3,4}});
417 Qureg qureg = createQureg(1);
418
419 // confirm not-unitary error suppressed...
420 REQUIRE_NOTHROW( applyCompMatr1(qureg, 0, m) );
421
422 // which otherwise triggers
424 REQUIRE_THROWS( applyCompMatr1(qureg, 0, m) );
425
426 destroyQureg(qureg);
427 }
428
429 SECTION( LABEL_VALIDATION ) {
430
431 // has no validation
432 SUCCEED( );
433 }
434
435 // ensure validation is on for remaining tests
437}
void setValidationOff()
Definition debug.cpp:86
void setValidationOn()
Definition debug.cpp:80

◆ TEST_CASE() [13/13]

TEST_CASE ( "setValidationOn" ,
TEST_CATEGORY  )

Definition at line 387 of file debug.cpp.

387 {
388
389 SECTION( LABEL_CORRECTNESS ) {
390
391 // always safe to call
392 for (int i=0; i<3; i++)
393 REQUIRE_NOTHROW( setValidationOn() );
394
395 // illegal and caught
396 REQUIRE_THROWS( setSeeds(nullptr, -99) );
397 }
398
399 SECTION( LABEL_VALIDATION ) {
400
401 // has no validation
402 SUCCEED( );
403 }
404}