- File:
-
- 1 edited
-
tests/concurrent/actors/poison.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrent/actors/poison.cfa
r858350a r1950837 5 5 #include <stdio.h> 6 6 7 struct Server { inline actor; }; 7 struct Server { int val; inline actor; }; 8 9 void ?{}( Server & this ) { this.val = 999; } 10 void ^?{}( Server & this ) { this.val = 777; } 8 11 9 12 int main() { … … 12 15 sout | "Finished"; 13 16 { 14 start_actor_system();15 Server s[10];16 for ( i; 10 ) {17 s[i] << FinishedMsg;18 }19 stop_actor_system();17 start_actor_system(); 18 Server s[10]; 19 for ( i; 10 ) { 20 s[i] << FinishedMsg; 21 } 22 stop_actor_system(); 20 23 } 21 24 22 25 sout | "Delete"; 23 26 { 24 start_actor_system();25 for ( i; 10 ) {26 Server * s = alloc();27 (*s){};28 (*s) << DeleteMsg;29 }30 stop_actor_system();27 start_actor_system(); 28 for ( i; 10 ) { 29 Server * s = alloc(); 30 (*s){}; 31 (*s) << DeleteMsg; 32 } 33 stop_actor_system(); 31 34 } 32 35 33 36 sout | "Destroy"; 34 37 { 35 start_actor_system(); 36 Server s[10]; 37 for ( i; 10 ) { 38 s[i] << DestroyMsg; 39 } 40 stop_actor_system(); 38 start_actor_system(); 39 Server s[10]; 40 for ( i; 10 ) 41 s[i] << DestroyMsg; 42 stop_actor_system(); 43 for ( i; 10 ) 44 if (s[i].val != 777) 45 sout | "Error: dtor not called correctly."; 41 46 } 42 47
Note:
See TracChangeset
for help on using the changeset viewer.