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

    r171f9a1 rcb01e1e  
    6464static atomic_t threads_fault;
    6565static waitq_t can_start;
    66 static bool sh_quiet;
    6766
    6867static void e(void *data)
     
    8685               
    8786                if ((int) (100000000 * e) != E_10e8) {
    88                         if (!sh_quiet)
    89                                 printf("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
     87                        TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
    9088                        atomic_inc(&threads_fault);
    9189                        break;
     
    120118               
    121119                if ((int) (1000000 * pi) != PI_10e8) {
    122                         if (!sh_quiet)
    123                                 printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
     120                        TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));
    124121                        atomic_inc(&threads_fault);
    125122                        break;
     
    129126}
    130127
    131 char * test_fpu1(bool quiet)
     128char *test_fpu1(void)
    132129{
    133130        unsigned int i, total = 0;
    134         sh_quiet = quiet;
    135131       
    136132        waitq_initialize(&can_start);
     
    138134        atomic_set(&threads_fault, 0);
    139135       
    140         if (!quiet)
    141                 printf("Creating %u threads... ", 2 * THREADS);
     136        TPRINTF("Creating %u threads... ", 2 * THREADS);
    142137       
    143         for (i = 0; i < THREADS; i++) { 
     138        for (i = 0; i < THREADS; i++) {
    144139                thread_t *t;
    145140               
    146141                if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) {
    147                         if (!quiet)
    148                                 printf("could not create thread %u\n", 2 * i);
     142                        TPRINTF("could not create thread %u\n", 2 * i);
    149143                        break;
    150144                }
     
    153147               
    154148                if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) {
    155                         if (!quiet)
    156                                 printf("could not create thread %u\n", 2 * i + 1);
     149                        TPRINTF("could not create thread %u\n", 2 * i + 1);
    157150                        break;
    158151                }
     
    161154        }
    162155       
    163         if (!quiet)
    164                 printf("ok\n");
     156        TPRINTF("ok\n");
    165157       
    166158        thread_sleep(1);
     
    168160       
    169161        while (atomic_get(&threads_ok) != (long) total) {
    170                 if (!quiet)
    171                         printf("Threads left: %d\n", total - atomic_get(&threads_ok));
     162                TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
    172163                thread_sleep(1);
    173164        }
Note: See TracChangeset for help on using the changeset viewer.