Changeset cb01e1e in mainline for kernel/test/fpu/fpu1_x86.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/fpu1_x86.c

    r171f9a1 rcb01e1e  
    6161static atomic_t threads_fault;
    6262static waitq_t can_start;
    63 static bool sh_quiet;
    6463
    6564static void e(void *data)
     
    8382               
    8483                if ((int) (100000000 * e) != E_10e8) {
    85                         if (!sh_quiet)
    86                                 printf("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
     84                        TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
    8785                        atomic_inc(&threads_fault);
    8886                        break;
     
    117115               
    118116                if ((int) (100000000 * pi) != PI_10e8) {
    119                         if (!sh_quiet)
    120                                 printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
     117                        TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
    121118                        atomic_inc(&threads_fault);
    122119                        break;
     
    126123}
    127124
    128 char * test_fpu1(bool quiet)
     125char *test_fpu1(void)
    129126{
    130127        unsigned int i, total = 0;
    131         sh_quiet = quiet;
    132128       
    133129        waitq_initialize(&can_start);
     
    135131        atomic_set(&threads_fault, 0);
    136132       
    137         if (!quiet)
    138                 printf("Creating %u threads... ", 2 * THREADS);
     133        TPRINTF("Creating %u threads... ", 2 * THREADS);
    139134       
    140         for (i = 0; i < THREADS; i++) { 
     135        for (i = 0; i < THREADS; i++) {
    141136                thread_t *t;
    142137               
    143138                if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) {
    144                         if (!quiet)
    145                                 printf("could not create thread %u\n", 2 * i);
     139                        TPRINTF("could not create thread %u\n", 2 * i);
    146140                        break;
    147141                }
     
    150144               
    151145                if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) {
    152                         if (!quiet)
    153                                 printf("could not create thread %u\n", 2 * i + 1);
     146                        TPRINTF("could not create thread %u\n", 2 * i + 1);
    154147                        break;
    155148                }
     
    158151        }
    159152       
    160         if (!quiet)
    161                 printf("ok\n");
     153        TPRINTF("ok\n");
    162154       
    163155        thread_sleep(1);
     
    165157       
    166158        while (atomic_get(&threads_ok) != (long) total) {
    167                 if (!quiet)
    168                         printf("Threads left: %d\n", total - atomic_get(&threads_ok));
     159                TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
    169160                thread_sleep(1);
    170161        }
Note: See TracChangeset for help on using the changeset viewer.