File: test.c

package info (click to toggle)
softbeep 0.3-15
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 136 kB
  • ctags: 47
  • sloc: ansic: 365; sh: 100; makefile: 75
file content (38 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include <unistd.h>

#define DEBUG(x) write(2, x, strlen(x))

int main() {
    char *t = "TEST\aTEST\n";
    
    DEBUG("Test #1\n");
    printf("%s", t);
    
    DEBUG("Test #2\n");
    fprintf(stdout, "%s", t);
    
    DEBUG("Test #3\n");
    fwrite(t, strlen(t), 1, stdout);
    
    DEBUG("Test #4\n");
    fputs(t, stdout);

    DEBUG("Test #5\n");
    puts(t);

    DEBUG("Test #6\n");
    write(1, t, strlen(t));

    DEBUG("Test #7\n"); 
    putc('\a', stdout); 
    
    DEBUG("Test #8\n"); 
    putchar('\a'); 

    DEBUG("Test #9\n");
    fputc('\a', stdout);

    
    return 0;
}