Changeset ef952d7
- Timestamp:
- Jun 14, 2018, 4:33:25 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 270fdcf
- Parents:
- d35e796
- Location:
- src/tests
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/concurrent/coroutineYield.c
rd35e796 ref952d7 5 5 #include <time> 6 6 7 #define __kick_rate 150000ul 7 8 #include "long_tests.h" 8 9 … … 25 26 void main(Coroutine& this) { 26 27 while(true) { 27 sout | "Coroutine 1" | endl; 28 #if !defined(TEST_FOREVER) 29 sout | "Coroutine 1" | endl; 30 #endif 28 31 yield(); 29 sout | "Coroutine 2" | endl; 32 #if !defined(TEST_FOREVER) 33 sout | "Coroutine 2" | endl; 34 #endif 30 35 suspend(); 31 36 } … … 36 41 Coroutine c; 37 42 for(int i = 0; TEST(i < N); i++) { 38 sout | "Thread 1" | endl; 43 #if !defined(TEST_FOREVER) 44 sout | "Thread 1" | endl; 45 #endif 39 46 resume(c); 40 sout | "Thread 2" | endl; 47 #if !defined(TEST_FOREVER) 48 sout | "Thread 2" | endl; 49 #endif 41 50 yield(); 42 51 KICK_WATCHDOG; -
src/tests/concurrent/signal/disjoint.c
rd35e796 ref952d7 69 69 } 70 70 71 d.counter++; 72 73 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 71 #if !defined(TEST_FOREVER) 72 d.counter++; 73 if( (d.counter % 1000) == 0 ) sout | d.counter | endl; 74 #endif 74 75 75 76 return TEST(d.counter < N); -
src/tests/concurrent/signal/wait.c
rd35e796 ref952d7 12 12 #include <time> 13 13 14 #define __kick_rate 12000ul 14 15 #include "long_tests.h" 15 16 -
src/tests/long_tests.h
rd35e796 ref952d7 4 4 5 5 #if defined(TEST_FOREVER) 6 7 static unsigned long long __kick_count = 0; 8 #if !defined(__kick_rate) 9 #define __kick_rate 5000ul 10 #endif 11 6 12 #define TEST(x) 1 7 #define KICK_WATCHDOG write(STDOUT_FILENO, ".", 1) 8 #elif defined(TEST_LONG) 13 #define KICK_WATCHDOG do { __kick_count++; if(__kick_count > __kick_rate) { write(STDOUT_FILENO, ".", 1); __kick_count = 0; } } while(0) 14 15 16 #else 17 9 18 #define TEST(x) x 10 19 #define KICK_WATCHDOG 11 #else 12 #define TEST(x) x 13 #define KICK_WATCHDOG 20 14 21 #endif -
src/tests/preempt_longrun/enter.c
rd35e796 ref952d7 4 4 #include <time> 5 5 6 #define __kick_rate 75000ul 6 7 #include "long_tests.h" 7 8 -
src/tests/preempt_longrun/enter3.c
rd35e796 ref952d7 4 4 #include <time> 5 5 6 #define __kick_rate 75000ul 6 7 #include "long_tests.h" 7 8 -
src/tests/preempt_longrun/stack.c
rd35e796 ref952d7 4 4 #include <time> 5 5 6 #define __kick_rate 5000000ul 6 7 #include "long_tests.h" 7 8 … … 17 18 18 19 void main(worker_t & this) { 19 volatile long long p = 5_021_609ul; 20 volatile long long a = 326_417ul; 21 volatile long long n = 1l; 22 for (volatile long long i = 0; TEST(i < p); i++) { 23 n *= a; 24 n %= p; 25 KICK_WATCHDOG; 26 } 20 while(TEST(0)) { 21 volatile long long p = 5_021_609ul; 22 volatile long long a = 326_417ul; 23 volatile long long n = 1l; 24 for (volatile long long i = 0; i < p; i++) { 25 n *= a; 26 n %= p; 27 KICK_WATCHDOG; 28 } 27 29 28 if( !TEST(n == a) ) { 29 abort(); 30 if( !TEST(n == a) ) { 31 abort(); 32 } 30 33 } 31 34 } -
src/tests/preempt_longrun/yield.c
rd35e796 ref952d7 3 3 #include <time> 4 4 5 #define __kick_rate 550000ul 5 6 #include "long_tests.h" 6 7
Note: See TracChangeset
for help on using the changeset viewer.