Changeset cb01e1e in mainline for kernel/test/fpu/mips2.c


Ignore:
Timestamp:
2009-04-04T00:26:27Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a85aebd
Parents:
171f9a1
Message:

use global variable and a macro for silencing tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/fpu/mips2.c

    r171f9a1 rcb01e1e  
    4444static atomic_t threads_fault;
    4545static waitq_t can_start;
    46 static bool sh_quiet;
    4746
    4847static void testit1(void *data)
     
    7069               
    7170                if (arg != after_arg) {
    72                         if (!sh_quiet)
    73                                 printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
     71                        TPRINTF("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
    7472                        atomic_inc(&threads_fault);
    7573                        break;
     
    102100               
    103101                if (arg != after_arg) {
    104                         if (!sh_quiet)
    105                                 printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
     102                        TPRINTF("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg);
    106103                        atomic_inc(&threads_fault);
    107104                        break;
     
    112109
    113110
    114 char * test_mips2(bool quiet)
     111char *test_mips2(void)
    115112{
    116113        unsigned int i, total = 0;
    117         sh_quiet = quiet;
    118114       
    119115        waitq_initialize(&can_start);
     
    121117        atomic_set(&threads_fault, 0);
    122118       
    123         if (!quiet)
    124                 printf("Creating %u threads... ", 2 * THREADS);
     119        TPRINTF("Creating %u threads... ", 2 * THREADS);
    125120       
    126121        for (i = 0; i < THREADS; i++) {
     
    128123               
    129124                if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) {
    130                         if (!quiet)
    131                                 printf("could not create thread %u\n", 2 * i);
     125                        TPRINTF("could not create thread %u\n", 2 * i);
    132126                        break;
    133127                }
     
    136130               
    137131                if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) {
    138                         if (!quiet)
    139                                 printf("could not create thread %u\n", 2 * i + 1);
     132                        TPRINTF("could not create thread %u\n", 2 * i + 1);
    140133                        break;
    141134                }
     
    144137        }
    145138       
    146         if (!quiet)
    147                 printf("ok\n");
     139        TPRINTF("ok\n");
    148140               
    149141        thread_sleep(1);
     
    151143       
    152144        while (atomic_get(&threads_ok) != (long) total) {
    153                 if (!quiet)
    154                         printf("Threads left: %d\n", total - atomic_get(&threads_ok));
     145                TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
    155146                thread_sleep(1);
    156147        }
Note: See TracChangeset for help on using the changeset viewer.