Changeset eb522e8 in mainline for kernel/test/print/print5.c


Ignore:
Timestamp:
2011-06-01T08:43:42Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d6c1f1
Parents:
9e2e715 (diff), e51a514 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Huuuuuge merge from development - all the work actually :)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/test/print/print5.c

    r9e2e715 reb522e8  
    11/*
    2  * Copyright (c) 2007 Jan Hudecek
    3  * Copyright (c) 2008 Martin Decky
     2 * Copyright (c) 2005 Josef Cejka
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    30 /** @addtogroup genericproc
    31  * @{
     29/*
     30 * This test tests several features of the HelenOS
     31 * printf() implementation which go beyond the POSIX
     32 * specification and GNU printf() behaviour.
     33 *
     34 * Therefore we disable printf() argument checking by
     35 * the GCC compiler in this source file to avoid false
     36 * positives.
     37 *
    3238 */
    33 /** @file tasklet.c
    34  *  @brief Tasklet implementation
    35  */
     39#define NVERIFY_PRINTF
    3640
    37 #include <proc/tasklet.h>
    38 #include <synch/spinlock.h>
    39 #include <mm/slab.h>
    40 #include <config.h>
     41#include <print.h>
     42#include <test.h>
    4143
    42 /** Spinlock protecting list of tasklets */
    43 SPINLOCK_INITIALIZE(tasklet_lock);
    44 
    45 /** Array of tasklet lists for every CPU */
    46 tasklet_descriptor_t **tasklet_list;
    47 
    48 void tasklet_init(void)
     44const char *test_print5(void)
    4945{
    50         unsigned int i;
     46        TPRINTF("Testing printf(\"%%s\", NULL):\n");
     47        TPRINTF("Expected output: \"(NULL)\"\n");
     48        TPRINTF("Real output:     \"%s\"\n\n", (char *) NULL);
    5149       
    52         tasklet_list = malloc(sizeof(tasklet_descriptor_t *) * config.cpu_count, 0);
    53         if (!tasklet_list)
    54                 panic("Error initializing tasklets.");
     50        TPRINTF("Testing printf(\"%%c %%3.2c %%-3.2c %%2.3c %%-2.3c\", 'a', 'b', 'c', 'd', 'e'):\n");
     51        TPRINTF("Expected output: [a] [  b] [c  ] [ d] [e ]\n");
     52        TPRINTF("Real output:     [%c] [%3.2c] [%-3.2c] [%2.3c] [%-2.3c]\n\n", 'a', 'b', 'c', 'd', 'e');
    5553       
    56         for (i = 0; i < config.cpu_count; i++)
    57                 tasklet_list[i] = NULL;
    58        
    59         spinlock_initialize(&tasklet_lock, "tasklet_lock");
     54        return NULL;
    6055}
    61 
    62 
    63 /** @}
    64  */
Note: See TracChangeset for help on using the changeset viewer.