Changeset cb01e1e in mainline for kernel/test/print/print1.c


Ignore:
Timestamp:
2009-04-04T00:26:27Z (17 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/print/print1.c

    r171f9a1 rcb01e1e  
    3030#include <test.h>
    3131
    32 char *test_print1(bool quiet)
     32char *test_print1(void)
    3333{
    34         if (!quiet) {
    35                 printf("Testing printf(\"%%*.*s\", 5, 3, \"text\"):\n");
    36                 printf("Expected output: \"  tex\"\n");
    37                 printf("Real output:     \"%*.*s\"\n\n", 5, 3, "text");
    38                
    39                 printf("Testing printf(\"%%10.8s\", \"very long text\"):\n");
    40                 printf("Expected output: \"  very lon\"\n");
    41                 printf("Real output:     \"%10.8s\"\n\n", "very long text");
    42                
    43                 printf("Testing printf(\"%%8.10s\", \"text\"):\n");
    44                 printf("Expected output: \"text\"\n");
    45                 printf("Real output:     \"%8.10s\"\n\n", "text");
    46                
    47                 printf("Testing printf(\"%%8.10s\", \"very long text\"):\n");
    48                 printf("Expected output: \"very long \"\n");
    49                 printf("Real output:     \"%8.10s\"\n\n", "very long text");
    50                
    51                 printf("Testing printf(\"%%s\", NULL):\n");
    52                 printf("Expected output: \"(NULL)\"\n");
    53                 printf("Real output:     \"%s\"\n\n", NULL);
    54         }
     34        TPRINTF("Testing printf(\"%%*.*s\", 5, 3, \"text\"):\n");
     35        TPRINTF("Expected output: \"  tex\"\n");
     36        TPRINTF("Real output:     \"%*.*s\"\n\n", 5, 3, "text");
     37       
     38        TPRINTF("Testing printf(\"%%10.8s\", \"very long text\"):\n");
     39        TPRINTF("Expected output: \"  very lon\"\n");
     40        TPRINTF("Real output:     \"%10.8s\"\n\n", "very long text");
     41       
     42        TPRINTF("Testing printf(\"%%8.10s\", \"text\"):\n");
     43        TPRINTF("Expected output: \"text\"\n");
     44        TPRINTF("Real output:     \"%8.10s\"\n\n", "text");
     45       
     46        TPRINTF("Testing printf(\"%%8.10s\", \"very long text\"):\n");
     47        TPRINTF("Expected output: \"very long \"\n");
     48        TPRINTF("Real output:     \"%8.10s\"\n\n", "very long text");
     49       
     50        TPRINTF("Testing printf(\"%%s\", NULL):\n");
     51        TPRINTF("Expected output: \"(NULL)\"\n");
     52        TPRINTF("Real output:     \"%s\"\n\n", NULL);
    5553       
    5654        return NULL;
Note: See TracChangeset for help on using the changeset viewer.