test/testatomic.c
changeset 3237 916f396fe65d
parent 3216 48a80f2a7ff2
child 3261 72b542f34739
     1.1 --- a/test/testatomic.c	Tue Aug 11 21:15:18 2009 +0000
     1.2 +++ b/test/testatomic.c	Tue Aug 11 21:27:19 2009 +0000
     1.3 @@ -23,12 +23,6 @@
     1.4  main(int argc, char **argv)
     1.5  {
     1.6  
     1.7 -   volatile Uint8 val8 = 0;
     1.8 -   Uint8 ret8 = 0;
     1.9 -
    1.10 -   volatile Uint16 val16 = 0;
    1.11 -   Uint16 ret16 = 0;
    1.12 -
    1.13     volatile Uint32 val32 = 0;
    1.14     Uint32 ret32 = 0;
    1.15  
    1.16 @@ -37,102 +31,6 @@
    1.17  
    1.18     SDL_bool tfret = SDL_FALSE;
    1.19  
    1.20 -
    1.21 -   printf("8 bit -----------------------------------------\n\n");
    1.22 -
    1.23 -   ret8 = SDL_AtomicExchange8(&val8, 10);
    1.24 -   printf("Exchange8           ret=%d val=%d\n", ret8, val8);
    1.25 -   ret8 = SDL_AtomicExchange8(&val8, 0);
    1.26 -   printf("Exchange8           ret=%d val=%d\n", ret8, val8);
    1.27 -
    1.28 -   val8 = 10;
    1.29 -   tfret = SDL_AtomicCompareThenSet8(&val8, 10, 20);
    1.30 -   printf("CompareThenSet8     tfret=%s val=%d\n", tf(tfret), val8);
    1.31 -   val8 = 10;
    1.32 -   tfret = SDL_AtomicCompareThenSet8(&val8, 0, 20);
    1.33 -   printf("CompareThenSet8     tfret=%s val=%d\n", tf(tfret), val8);
    1.34 -
    1.35 -   val8 = 0;
    1.36 -   tfret = SDL_AtomicTestThenSet8(&val8);
    1.37 -   printf("TestThenSet8        tfret=%s val=%d\n", tf(tfret), val8);
    1.38 -   tfret = SDL_AtomicTestThenSet8(&val8);
    1.39 -   printf("TestThenSet8        tfret=%s val=%d\n", tf(tfret), val8);
    1.40 -
    1.41 -   SDL_AtomicClear8(&val8);
    1.42 -   printf("Clear8              val=%d\n", val8);
    1.43 -
    1.44 -   ret8 = SDL_AtomicFetchThenIncrement8(&val8);
    1.45 -   printf("FetchThenIncrement8 ret=%d val=%d\n", ret8, val8);
    1.46 -
    1.47 -   ret8 = SDL_AtomicFetchThenDecrement8(&val8);
    1.48 -   printf("FetchThenDecrement8 ret=%d val=%d\n", ret8, val8);
    1.49 -
    1.50 -   ret8 = SDL_AtomicFetchThenAdd8(&val8, 10);
    1.51 -   printf("FetchThenAdd8       ret=%d val=%d\n", ret8, val8);
    1.52 -
    1.53 -   ret8 = SDL_AtomicFetchThenSubtract8(&val8, 10);
    1.54 -   printf("FetchThenSubtract8  ret=%d val=%d\n", ret8, val8);
    1.55 -
    1.56 -   ret8 = SDL_AtomicIncrementThenFetch8(&val8);
    1.57 -   printf("IncrementThenFetch8 ret=%d val=%d\n", ret8, val8);
    1.58 -
    1.59 -   ret8 = SDL_AtomicDecrementThenFetch8(&val8);
    1.60 -   printf("DecrementThenFetch8 ret=%d val=%d\n", ret8, val8);
    1.61 -
    1.62 -   ret8 = SDL_AtomicAddThenFetch8(&val8, 10);
    1.63 -   printf("AddThenFetch8       ret=%d val=%d\n", ret8, val8);
    1.64 -
    1.65 -   ret8 = SDL_AtomicSubtractThenFetch8(&val8, 10);
    1.66 -   printf("SubtractThenFetch8  ret=%d val=%d\n", ret8, val8);
    1.67 -
    1.68 -
    1.69 -   printf("16 bit -----------------------------------------\n\n");
    1.70 -
    1.71 -   ret16 = SDL_AtomicExchange16(&val16, 10);
    1.72 -   printf("Exchange16           ret=%d val=%d\n", ret16, val16);
    1.73 -   ret16 = SDL_AtomicExchange16(&val16, 0);
    1.74 -   printf("Exchange16           ret=%d val=%d\n", ret16, val16);
    1.75 -
    1.76 -   val16 = 10;
    1.77 -   tfret = SDL_AtomicCompareThenSet16(&val16, 10, 20);
    1.78 -   printf("CompareThenSet16     tfret=%s val=%d\n", tf(tfret), val16);
    1.79 -   val16 = 10;
    1.80 -   tfret = SDL_AtomicCompareThenSet16(&val16, 0, 20);
    1.81 -   printf("CompareThenSet16     tfret=%s val=%d\n", tf(tfret), val16);
    1.82 -
    1.83 -   val16 = 0;
    1.84 -   tfret = SDL_AtomicTestThenSet16(&val16);
    1.85 -   printf("TestThenSet16        tfret=%s val=%d\n", tf(tfret), val16);
    1.86 -   tfret = SDL_AtomicTestThenSet16(&val16);
    1.87 -   printf("TestThenSet16        tfret=%s val=%d\n", tf(tfret), val16);
    1.88 -
    1.89 -   SDL_AtomicClear16(&val16);
    1.90 -   printf("Clear16              val=%d\n", val16);
    1.91 -
    1.92 -   ret16 = SDL_AtomicFetchThenIncrement16(&val16);
    1.93 -   printf("FetchThenIncrement16 ret=%d val=%d\n", ret16, val16);
    1.94 -
    1.95 -   ret16 = SDL_AtomicFetchThenDecrement16(&val16);
    1.96 -   printf("FetchThenDecrement16 ret=%d val=%d\n", ret16, val16);
    1.97 -
    1.98 -   ret16 = SDL_AtomicFetchThenAdd16(&val16, 10);
    1.99 -   printf("FetchThenAdd16       ret=%d val=%d\n", ret16, val16);
   1.100 -
   1.101 -   ret16 = SDL_AtomicFetchThenSubtract16(&val16, 10);
   1.102 -   printf("FetchThenSubtract16  ret=%d val=%d\n", ret16, val16);
   1.103 -
   1.104 -   ret16 = SDL_AtomicIncrementThenFetch16(&val16);
   1.105 -   printf("IncrementThenFetch16 ret=%d val=%d\n", ret16, val16);
   1.106 -
   1.107 -   ret16 = SDL_AtomicDecrementThenFetch16(&val16);
   1.108 -   printf("DecrementThenFetch16 ret=%d val=%d\n", ret16, val16);
   1.109 -
   1.110 -   ret16 = SDL_AtomicAddThenFetch16(&val16, 10);
   1.111 -   printf("AddThenFetch16       ret=%d val=%d\n", ret16, val16);
   1.112 -
   1.113 -   ret16 = SDL_AtomicSubtractThenFetch16(&val16, 10);
   1.114 -   printf("SubtractThenFetch16  ret=%d val=%d\n", ret16, val16);
   1.115 -
   1.116     printf("32 bit -----------------------------------------\n\n");
   1.117  
   1.118     ret32 = SDL_AtomicExchange32(&val32, 10);