test/testatomic.c
changeset 3199 3e1bf2b8bd81
parent 3186 51750b7a966f
child 3201 c297230efc75
     1.1 --- a/test/testatomic.c	Wed Jun 17 04:26:19 2009 +0000
     1.2 +++ b/test/testatomic.c	Wed Jun 24 20:04:08 2009 +0000
     1.3 @@ -3,62 +3,62 @@
     1.4  int
     1.5  main(int argc, char **argv)
     1.6  {
     1.7 -    int rv = 10;
     1.8 -    volatile int atomic;
     1.9 +/*     int rv = 10; */
    1.10 +/*     volatile int atomic; */
    1.11  
    1.12 -    SDL_atomic_int_set(&atomic, 10);
    1.13 -    if (SDL_atomic_int_get(&atomic) != 10)
    1.14 -        printf("Error: ");
    1.15 -    printf("SDL_atomic_int_set(atomic, 10): atomic-> %d\n",
    1.16 -           SDL_atomic_int_get(&atomic));
    1.17 +/*     SDL_atomic_int_set(&atomic, 10); */
    1.18 +/*     if (SDL_atomic_int_get(&atomic) != 10) */
    1.19 +/*         printf("Error: "); */
    1.20 +/*     printf("SDL_atomic_int_set(atomic, 10): atomic-> %d\n", */
    1.21 +/*            SDL_atomic_int_get(&atomic)); */
    1.22  
    1.23 -    SDL_atomic_int_add(&atomic, 10);
    1.24 -    if (SDL_atomic_int_get(&atomic) != 20)
    1.25 -        printf("Error: ");
    1.26 -    printf("SDL_atomic_int_add(atomic, 10): atomic-> %d\n",
    1.27 -           SDL_atomic_int_get(&atomic));
    1.28 +/*     SDL_atomic_int_add(&atomic, 10); */
    1.29 +/*     if (SDL_atomic_int_get(&atomic) != 20) */
    1.30 +/*         printf("Error: "); */
    1.31 +/*     printf("SDL_atomic_int_add(atomic, 10): atomic-> %d\n", */
    1.32 +/*            SDL_atomic_int_get(&atomic)); */
    1.33  
    1.34 -    rv = SDL_atomic_int_cmp_xchg(&atomic, 20, 30);
    1.35 -    if (rv != SDL_TRUE || SDL_atomic_int_get(&atomic) != 30)
    1.36 -        printf("Error: ");
    1.37 -    printf("SDL_atomic_int_cmp_xchg(atomic, 20, 30): rv-> %d, atomic-> %d\n",
    1.38 -           rv, SDL_atomic_int_get(&atomic));
    1.39 +/*     rv = SDL_atomic_int_cmp_xchg(&atomic, 20, 30); */
    1.40 +/*     if (rv != SDL_TRUE || SDL_atomic_int_get(&atomic) != 30) */
    1.41 +/*         printf("Error: "); */
    1.42 +/*     printf("SDL_atomic_int_cmp_xchg(atomic, 20, 30): rv-> %d, atomic-> %d\n", */
    1.43 +/*            rv, SDL_atomic_int_get(&atomic)); */
    1.44  
    1.45 -    rv = SDL_atomic_int_cmp_xchg(&atomic, 20, 30);
    1.46 -    if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 30)
    1.47 -        printf("Error: ");
    1.48 -    printf("SDL_atomic_int_cmp_xchg(atomic, 20, 40): rv-> %d, atomic-> %d\n",
    1.49 -           rv, SDL_atomic_int_get(&atomic));
    1.50 +/*     rv = SDL_atomic_int_cmp_xchg(&atomic, 20, 30); */
    1.51 +/*     if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 30) */
    1.52 +/*         printf("Error: "); */
    1.53 +/*     printf("SDL_atomic_int_cmp_xchg(atomic, 20, 40): rv-> %d, atomic-> %d\n", */
    1.54 +/*            rv, SDL_atomic_int_get(&atomic)); */
    1.55  
    1.56 -    rv = SDL_atomic_int_xchg_add(&atomic, 10);
    1.57 -    if (rv != 30 || SDL_atomic_int_get(&atomic) != 40)
    1.58 -        printf("Error: ");
    1.59 -    printf("SDL_atomic_int_xchg_add(atomic, 10): rv-> %d, atomic-> %d\n",
    1.60 -           rv, SDL_atomic_int_get(&atomic));
    1.61 +/*     rv = SDL_atomic_int_xchg_add(&atomic, 10); */
    1.62 +/*     if (rv != 30 || SDL_atomic_int_get(&atomic) != 40) */
    1.63 +/*         printf("Error: "); */
    1.64 +/*     printf("SDL_atomic_int_xchg_add(atomic, 10): rv-> %d, atomic-> %d\n", */
    1.65 +/*            rv, SDL_atomic_int_get(&atomic)); */
    1.66  
    1.67 -    SDL_atomic_int_inc(&atomic);
    1.68 -    if (SDL_atomic_int_get(&atomic) != 41)
    1.69 -        printf("Error: ");
    1.70 -    printf("SDL_atomic_int_inc(atomic): atomic-> %d\n",
    1.71 -           SDL_atomic_int_get(&atomic));
    1.72 +/*     SDL_atomic_int_inc(&atomic); */
    1.73 +/*     if (SDL_atomic_int_get(&atomic) != 41) */
    1.74 +/*         printf("Error: "); */
    1.75 +/*     printf("SDL_atomic_int_inc(atomic): atomic-> %d\n", */
    1.76 +/*            SDL_atomic_int_get(&atomic)); */
    1.77  
    1.78 -    rv = SDL_atomic_int_dec_test(&atomic);
    1.79 -    if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 40)
    1.80 -        printf("Error: ");
    1.81 -    printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n",
    1.82 -           rv, SDL_atomic_int_get(&atomic));
    1.83 +/*     rv = SDL_atomic_int_dec_test(&atomic); */
    1.84 +/*     if (rv != SDL_FALSE || SDL_atomic_int_get(&atomic) != 40) */
    1.85 +/*         printf("Error: "); */
    1.86 +/*     printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n", */
    1.87 +/*            rv, SDL_atomic_int_get(&atomic)); */
    1.88  
    1.89 -    SDL_atomic_int_set(&atomic, 1);
    1.90 -    if (SDL_atomic_int_get(&atomic) != 1)
    1.91 -        printf("Error: ");
    1.92 -    printf("SDL_atomic_int_set(atomic, 1): atomic-> %d\n",
    1.93 -           SDL_atomic_int_get(&atomic));
    1.94 +/*     SDL_atomic_int_set(&atomic, 1); */
    1.95 +/*     if (SDL_atomic_int_get(&atomic) != 1) */
    1.96 +/*         printf("Error: "); */
    1.97 +/*     printf("SDL_atomic_int_set(atomic, 1): atomic-> %d\n", */
    1.98 +/*            SDL_atomic_int_get(&atomic)); */
    1.99  
   1.100 -    rv = SDL_atomic_int_dec_test(&atomic);
   1.101 -    if (rv != SDL_TRUE || SDL_atomic_int_get(&atomic) != 0)
   1.102 -        printf("Error: ");
   1.103 -    printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n",
   1.104 -           rv, SDL_atomic_int_get(&atomic));
   1.105 +/*     rv = SDL_atomic_int_dec_test(&atomic); */
   1.106 +/*     if (rv != SDL_TRUE || SDL_atomic_int_get(&atomic) != 0) */
   1.107 +/*         printf("Error: "); */
   1.108 +/*     printf("SDL_atomic_int_dec_test(atomic): rv-> %d, atomic-> %d\n", */
   1.109 +/*            rv, SDL_atomic_int_get(&atomic)); */
   1.110  
   1.111      return 0;
   1.112  }