35
35
#include < boost/thread/csbl/memory/unique_ptr.hpp>
36
36
#include < memory>
37
37
#include < boost/detail/lightweight_test.hpp>
38
+ #include " ../../../timming.hpp"
38
39
39
40
typedef boost::chrono::high_resolution_clock Clock;
40
41
typedef boost::chrono::milliseconds ms;
@@ -159,7 +160,7 @@ struct check_timer {
159
160
}
160
161
~check_timer () {
161
162
Clock::time_point now = Clock::now ();
162
- BOOST_TEST (now - start < delay);
163
+ BOOST_THREAD_TEST_IT (now - start, delay);
163
164
std::cout << __FILE__ << " [" << __LINE__ << " ] " << (now - start).count () << std::endl;
164
165
}
165
166
@@ -217,7 +218,7 @@ int main()
217
218
boost::this_thread::sleep_for (ms (300 ));
218
219
int res;
219
220
{
220
- check_timer timer (ms (500 ));
221
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
221
222
res = f.get ();
222
223
}
223
224
BOOST_TEST (res == 3 );
@@ -241,7 +242,7 @@ int main()
241
242
boost::this_thread::sleep_for (ms (300 ));
242
243
int res;
243
244
{
244
- check_timer timer (ms (500 ));
245
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
245
246
res = f.get ();
246
247
}
247
248
BOOST_TEST (res == 3 );
@@ -265,7 +266,7 @@ int main()
265
266
boost::this_thread::sleep_for (ms (300 ));
266
267
int res;
267
268
{
268
- check_timer timer (ms (500 ));
269
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
269
270
res = f.get ();
270
271
}
271
272
BOOST_TEST (res == 3 );
@@ -289,7 +290,7 @@ int main()
289
290
boost::this_thread::sleep_for (ms (300 ));
290
291
int res;
291
292
{
292
- check_timer timer (ms (500 ));
293
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
293
294
res = f.get ();
294
295
}
295
296
BOOST_TEST (res == 3 );
@@ -314,7 +315,7 @@ int main()
314
315
// boost::this_thread::sleep_for(ms(300));
315
316
int res;
316
317
{
317
- check_timer timer (ms (500 ));
318
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
318
319
res = f.get ();
319
320
}
320
321
BOOST_TEST (res == 3 );
@@ -341,7 +342,7 @@ int main()
341
342
boost::this_thread::sleep_for (ms (300 ));
342
343
int res;
343
344
{
344
- check_timer timer (ms (500 ));
345
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
345
346
res = f.get ();
346
347
}
347
348
BOOST_TEST (res == 3 );
@@ -366,7 +367,7 @@ int main()
366
367
boost::this_thread::sleep_for (ms (300 ));
367
368
int res;
368
369
{
369
- check_timer timer (ms (500 ));
370
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
370
371
res = f.get ();
371
372
}
372
373
BOOST_TEST (res == 3 );
@@ -391,7 +392,7 @@ int main()
391
392
boost::this_thread::sleep_for (ms (300 ));
392
393
int res;
393
394
{
394
- check_timer timer (ms (500 ));
395
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
395
396
res = f.get ();
396
397
}
397
398
BOOST_TEST (res == 3 );
@@ -415,7 +416,7 @@ int main()
415
416
boost::this_thread::sleep_for (ms (300 ));
416
417
int res;
417
418
{
418
- check_timer timer (ms (500 ));
419
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
419
420
res = f.get ();
420
421
}
421
422
BOOST_TEST (res == 3 );
@@ -439,7 +440,7 @@ int main()
439
440
boost::this_thread::sleep_for (ms (300 ));
440
441
int res;
441
442
{
442
- check_timer timer (ms (500 ));
443
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
443
444
res = f.get ();
444
445
}
445
446
BOOST_TEST (res == 3 );
@@ -463,7 +464,7 @@ int main()
463
464
// boost::this_thread::sleep_for(ms(300));
464
465
int res;
465
466
{
466
- check_timer timer (ms (500 ));
467
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
467
468
res = f.get ();
468
469
}
469
470
BOOST_TEST (res == 3 );
@@ -487,7 +488,7 @@ int main()
487
488
boost::this_thread::sleep_for (ms (300 ));
488
489
int * res;
489
490
{
490
- check_timer timer (ms (500 ));
491
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
491
492
res = &f.get ();
492
493
}
493
494
BOOST_TEST (res == &i);
@@ -510,7 +511,7 @@ int main()
510
511
boost::this_thread::sleep_for (ms (300 ));
511
512
int * res;
512
513
{
513
- check_timer timer (ms (500 ));
514
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
514
515
res = &f.get ();
515
516
}
516
517
BOOST_TEST (res == &i);
@@ -533,7 +534,7 @@ int main()
533
534
boost::this_thread::sleep_for (ms (300 ));
534
535
int * res;
535
536
{
536
- check_timer timer (ms (500 ));
537
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
537
538
res = &f.get ();
538
539
}
539
540
BOOST_TEST (res == &i);
@@ -557,7 +558,7 @@ int main()
557
558
// boost::this_thread::sleep_for(ms(300));
558
559
int * res;
559
560
{
560
- check_timer timer (ms (500 ));
561
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
561
562
res = &f.get ();
562
563
}
563
564
BOOST_TEST (res == &i);
@@ -580,7 +581,7 @@ int main()
580
581
boost::future<void > f = boost::async (f2);
581
582
boost::this_thread::sleep_for (ms (300 ));
582
583
{
583
- check_timer timer (ms (500 ));
584
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
584
585
f.get ();
585
586
}
586
587
}
@@ -601,7 +602,7 @@ int main()
601
602
boost::future<void > f = boost::async (boost::launch::async, f2);
602
603
boost::this_thread::sleep_for (ms (300 ));
603
604
{
604
- check_timer timer (ms (500 ));
605
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
605
606
f.get ();
606
607
}
607
608
}
@@ -622,7 +623,7 @@ int main()
622
623
boost::future<void > f = boost::async (boost::launch::any, f2);
623
624
boost::this_thread::sleep_for (ms (300 ));
624
625
{
625
- check_timer timer (ms (500 ));
626
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
626
627
f.get ();
627
628
}
628
629
}
@@ -644,7 +645,7 @@ int main()
644
645
boost::future<void > f = boost::async (boost::launch::deferred, f2);
645
646
// boost::this_thread::sleep_for(ms(300));
646
647
{
647
- check_timer timer (ms (500 ));
648
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
648
649
f.get ();
649
650
}
650
651
}
@@ -668,7 +669,7 @@ int main()
668
669
boost::this_thread::sleep_for (ms (300 ));
669
670
MoveOnly res;
670
671
{
671
- check_timer timer (ms (500 ));
672
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
672
673
res = f.get ();
673
674
}
674
675
BOOST_TEST_EQ (res.value , 2 );
@@ -692,7 +693,7 @@ int main()
692
693
// boost::this_thread::sleep_for(ms(300));
693
694
MoveOnly res;
694
695
{
695
- check_timer timer (ms (500 ));
696
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
696
697
res = f.get ();
697
698
}
698
699
BOOST_TEST_EQ (res.value , 2 );
@@ -717,7 +718,7 @@ int main()
717
718
boost::this_thread::sleep_for (ms (300 ));
718
719
MoveOnly res;
719
720
{
720
- check_timer timer (ms (500 ));
721
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
721
722
res = f.get ();
722
723
}
723
724
BOOST_TEST (res.value == 2 );
@@ -740,7 +741,7 @@ int main()
740
741
boost::this_thread::sleep_for (ms (300 ));
741
742
boost::csbl::unique_ptr<int > res;
742
743
{
743
- check_timer timer (ms (500 ));
744
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
744
745
res = f.get ();
745
746
}
746
747
BOOST_TEST (*res == 3 );
@@ -765,7 +766,7 @@ int main()
765
766
boost::this_thread::sleep_for (ms (300 ));
766
767
boost::csbl::unique_ptr<int > res;
767
768
{
768
- check_timer timer (ms (500 ));
769
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
769
770
res = f.get ();
770
771
}
771
772
BOOST_TEST (*res == 3 );
@@ -788,7 +789,7 @@ int main()
788
789
// boost::this_thread::sleep_for(ms(300));
789
790
boost::csbl::unique_ptr<int > res;
790
791
{
791
- check_timer timer (ms (500 ));
792
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
792
793
res = f.get ();
793
794
}
794
795
BOOST_TEST (*res == 3 );
@@ -811,7 +812,7 @@ int main()
811
812
boost::this_thread::sleep_for (ms (300 ));
812
813
boost::csbl::unique_ptr<int > res;
813
814
{
814
- check_timer timer (ms (500 ));
815
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
815
816
res = f.get ();
816
817
}
817
818
BOOST_TEST (*res == 3 );
@@ -837,7 +838,7 @@ int main()
837
838
boost::this_thread::sleep_for (ms (300 ));
838
839
boost::csbl::unique_ptr<int > res;
839
840
{
840
- check_timer timer (ms (500 ));
841
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
841
842
res = f.get ();
842
843
}
843
844
BOOST_TEST (*res == 3 );
@@ -860,7 +861,7 @@ int main()
860
861
// boost::this_thread::sleep_for(ms(300));
861
862
boost::csbl::unique_ptr<int > res;
862
863
{
863
- check_timer timer (ms (500 ));
864
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
864
865
res = f.get ();
865
866
}
866
867
BOOST_TEST (*res == 3 );
@@ -883,7 +884,7 @@ int main()
883
884
boost::this_thread::sleep_for (ms (300 ));
884
885
boost::csbl::unique_ptr<int > res;
885
886
{
886
- check_timer timer (ms (500 ));
887
+ check_timer timer (ms (200 + BOOST_THREAD_TEST_TIME_MS ));
887
888
res = f.get ();
888
889
}
889
890
BOOST_TEST (*res == 3 );
0 commit comments