Changeset 7e13972 in mainline


Ignore:
Timestamp:
2006-12-12T18:51:06Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cce6acf
Parents:
96348adc
Message:

remove asserts and panics from tests

Location:
kernel/test
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/debug/mips1.c

    r96348adc r7e13972  
    3131#include <print.h>
    3232#include <debug.h>
    33 #include <panic.h>
    3433
    3534#include <test.h>
  • kernel/test/fault/fault1.c

    r96348adc r7e13972  
    3030#include <print.h>
    3131#include <debug.h>
    32 #include <panic.h>
    3332
    3433#include <test.h>
  • kernel/test/fpu/fpu1.c

    r96348adc r7e13972  
    3232#include <print.h>
    3333#include <debug.h>
    34 #include <panic.h>
    3534
    3635#include <test.h>
  • kernel/test/fpu/mips2.c

    r96348adc r7e13972  
    3131#include <print.h>
    3232#include <debug.h>
    33 #include <panic.h>
    3433
    3534#include <test.h>
     
    103102               
    104103                if (arg != after_arg) {
    105                         panic("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
     104                        printf("General reg tid%d: arg(%d) != %d\n", THREAD->tid, arg, after_arg);
    106105                        atomic_inc(&threads_fault);
    107106                        break;
  • kernel/test/fpu/sse1.c

    r96348adc r7e13972  
    3131#include <print.h>
    3232#include <debug.h>
    33 #include <panic.h>
    3433
    3534#include <test.h>
  • kernel/test/mm/falloc1.c

    r96348adc r7e13972  
    4747        int i, order, run;
    4848        int allocated;
    49 
    50         ASSERT(TEST_RUNS > 1);
     49       
     50        if (TEST_RUNS < 2)
     51                return "Test is compiled with TEST_RUNS < 2";
     52       
    5153        if (frames == NULL)
    5254                return "Unable to allocate frames";
  • kernel/test/mm/mapping1.c

    r96348adc r7e13972  
    6363        printf("Value at virtual address %p is %#x.\n", PAGE1, v1 = *((uint32_t *) PAGE1));
    6464       
    65         ASSERT(v0 == VALUE0);
    66         ASSERT(v1 == VALUE1);
     65        if (v0 != VALUE0)
     66                return "Value at v0 not equal to VALUE0";
     67        if (v1 != VALUE1)
     68                return "Value at v1 not equal to VALUE1";
    6769
    6870        printf("Writing %#x to virtual address %p.\n", 0, PAGE0);
     
    7779        printf("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1));
    7880
    79         ASSERT(v0 == 0);
    80         ASSERT(v1 == 0);
     81        if (v0 != 0)
     82                return "Value at v0 not equal to 0";
     83        if (v1 != 0)
     84                return "Value at v1 not equal to 0";
    8185       
    8286        return NULL;   
  • kernel/test/mm/slab1.c

    r96348adc r7e13972  
    3232#include <proc/thread.h>
    3333#include <arch.h>
    34 #include <panic.h>
    3534#include <memstr.h>
    3635
  • kernel/test/mm/slab2.c

    r96348adc r7e13972  
    3232#include <proc/thread.h>
    3333#include <arch.h>
    34 #include <panic.h>
    3534#include <mm/frame.h>
    3635#include <memstr.h>
     
    8988                data1 = slab_alloc(cache1, FRAME_ATOMIC);
    9089                if (!data1) {
    91                         panic("Incorrect memory size - use another test.");
     90                        printf("Incorrect memory size - use another test.");
     91                        return;
    9292                }
    9393                memsetb((uintptr_t)data1, ITEM_SIZE, 0);
  • kernel/test/synch/rwlock4.c

    r96348adc r7e13972  
    3535#include <arch/context.h>
    3636#include <context.h>
    37 #include <panic.h>
    3837
    3938#include <synch/waitq.h>
     
    4645
    4746static rwlock_t rwlock;
     47static atomic_t threads_fault;
    4848
    4949SPINLOCK_INITIALIZE(rw_lock);
     
    7979        printf("cpu%d, tid %d w=\n", CPU->id, THREAD->tid);
    8080
    81         if (rwlock.readers_in) panic("Oops.");
     81        if (rwlock.readers_in) {
     82                printf("Oops.");
     83                atomic_inc(&threads_fault);
     84                return;
     85        }
    8286        thread_usleep(random(1000000));
    83         if (rwlock.readers_in) panic("Oops."); 
     87        if (rwlock.readers_in) {
     88                printf("Oops.");       
     89                atomic_inc(&threads_fault);
     90                return;
     91        }
    8492
    8593        rwlock_write_unlock(&rwlock);
     
    113121        waitq_initialize(&can_start);
    114122        rwlock_initialize(&rwlock);
     123        atomic_set(&threads_fault, 0);
    115124       
    116125        thread_t *thrd;
     
    131140        k = random(5) + 1;
    132141        printf("Creating %d writers\n", k);
    133         for (i=0; i<k; i++) {
     142        for (i = 0; i < k; i++) {
    134143                thrd = thread_create(writer, NULL, TASK, 0, "writer");
    135144                if (thrd)
     
    142151        waitq_wakeup(&can_start, WAKEUP_ALL);
    143152       
    144         return NULL;
     153        if (atomic_get(&threads_fault) == 0)
     154                return NULL;
     155       
     156        return "Test failed";
    145157}
  • kernel/test/sysinfo/sysinfo1.c

    r96348adc r7e13972  
    2929#include <print.h>
    3030#include <debug.h>
    31 #include <panic.h>
    3231
    3332#include <test.h>
  • kernel/test/thread/thread1.c

    r96348adc r7e13972  
    3030#include <print.h>
    3131#include <debug.h>
    32 #include <panic.h>
    3332
    3433#include <test.h>
Note: See TracChangeset for help on using the changeset viewer.