Changeset 0322865


Ignore:
Timestamp:
Jul 11, 2017, 3:11:42 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
f2b12406
Parents:
67f2170
Message:

Cleaned long tests to be more consistent and offer more debug information

Location:
src/tests
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/tests/preempt.c

    r67f2170 r0322865  
    1212static volatile int counter = 0;
    1313
    14 thread Worker {
     14thread worker_t {
    1515        int value;
    1616};
    1717
    18 void ?{}( Worker * this, int value ) {
     18void ?{}( worker_t * this, int value ) {
    1919        this->value = value;
    2020}
    2121
    22 void main(Worker * this) {
     22void main(worker_t * this) {
    2323        while(counter < 1000) {
    2424                if( (counter % 7) == this->value ) {
     
    3232        processor p;
    3333        {
    34                 Worker w0 = 0;
    35                 Worker w1 = 1;
    36                 Worker w2 = 2;
    37                 Worker w3 = 3;
    38                 Worker w4 = 4;
    39                 Worker w5 = 5;
    40                 Worker w6 = 6;
     34                worker_t w0 = 0;
     35                worker_t w1 = 1;
     36                worker_t w2 = 2;
     37                worker_t w3 = 3;
     38                worker_t w4 = 4;
     39                worker_t w5 = 5;
     40                worker_t w6 = 6;
    4141        }
    4242}
  • src/tests/preempt_longrun/create.c

    r67f2170 r0322865  
    1010}
    1111
    12 thread Worker {};
     12thread worker_t {};
    1313
    14 void main(Worker * this) {}
     14void main(worker_t * this) {}
    1515
    1616int main(int argc, char* argv[]) {
    17         for(int i = 0; i < 250_000ul; i++) {
    18                 Worker w;
     17        for(int i = 0; i < 10_000ul; i++) {
     18                worker_t w[7];
    1919        }
    2020}
  • src/tests/preempt_longrun/enter.c

    r67f2170 r0322865  
    2828}
    2929
     30extern "C" {
     31static worker_t * workers;
     32}
     33
    3034int main(int argc, char * argv[] ) {
    3135        processor p;
    3236        {
    3337                worker_t w[7];
     38                workers = w;
    3439        }
    3540}
  • src/tests/preempt_longrun/enter3.c

    r67f2170 r0322865  
    2828}
    2929
     30extern "C" {
     31static worker_t * workers;
     32}
     33
    3034int main(int argc, char * argv[] ) {
    3135        processor p;
    3236        {
    3337                worker_t w[7];
     38                workers = w;
    3439        }
    3540}
  • src/tests/preempt_longrun/processor.c

    r67f2170 r0322865  
    1010}
    1111
    12 thread Worker {};
     12thread worker_t {};
    1313
    14 void main(Worker * this) {}
     14void main(worker_t * this) {}
    1515
    1616int main(int argc, char* argv[]) {
  • src/tests/preempt_longrun/stack.c

    r67f2170 r0322865  
    1212}
    1313
    14 thread Worker {};
     14thread worker_t {};
    1515
    16 void main(Worker * this) {
     16void main(worker_t * this) {
    1717        volatile long p = 5_021_609ul;
    1818        volatile long a = 326_417ul;
    1919        volatile long n = 1l;
    20         for (volatile long i = 0; i < p; i++) { 
    21                 n *= a; 
    22                 n %= p; 
     20        for (volatile long i = 0; i < p; i++) {
     21                n *= a;
     22                n %= p;
    2323        }
    24                
     24
    2525        if( n != a ) {
    2626                abort();
     
    2828}
    2929
     30extern "C" {
     31static worker_t * workers;
     32}
     33
    3034int main(int argc, char* argv[]) {
    3135        processor p;
    3236        {
    33                 Worker w[7];
     37                worker_t w[7];
     38                workers = w;
    3439        }
    3540}
  • src/tests/preempt_longrun/yield.c

    r67f2170 r0322865  
    1010}
    1111
    12 thread Worker {};
     12thread worker_t {};
    1313
    14 void main(Worker * this) {
     14void main(worker_t * this) {
    1515        for(int i = 0; i < 325_000ul; i++) {
    1616                yield();
     
    1818}
    1919
     20extern "C" {
     21static worker_t * workers;
     22}
     23
    2024int main(int argc, char* argv[]) {
    2125        processor p;
    2226        {
    23                 Worker w[7];
     27                worker_t w[7];
     28                workers = w;
    2429        }
    2530}
  • src/tests/sched-int-disjoint.c

    r67f2170 r0322865  
    55
    66#ifndef N
    7 #define N 100_000
     7#define N 10_000
    88#endif
    99
     
    4242
    4343void main( Barger * this ) {
    44         while( !all_done ) { 
     44        while( !all_done ) {
    4545                barge( &data );
    46                 yield(); 
     46                yield();
    4747        }
    4848}
     
    5353        wait( &cond );
    5454        if( d->state != SIGNAL ) {
    55                 sout | "ERROR barging!" | endl; 
     55                sout | "ERROR barging!" | endl;
    5656        }
    5757
     
    8585        bool running = data.counter < N && data.counter > 0;
    8686        if( data.state != SIGNAL && running ) {
    87                 sout | "ERROR Eager signal" | data.state | endl; 
     87                sout | "ERROR Eager signal" | data.state | endl;
    8888        }
    8989}
     
    9292
    9393void main( Signaller * this ) {
    94         while( !all_done ) { 
     94        while( !all_done ) {
    9595                logic( &mut );
    96                 yield(); 
     96                yield();
    9797        }
    9898}
     
    111111                sout | "All waiter done" | endl;
    112112                all_done = true;
    113         }       
     113        }
    114114}
Note: See TracChangeset for help on using the changeset viewer.