Subversion Repositories HelenOS

Rev

Rev 2022 | Rev 2050 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2022 Rev 2028
Line 28... Line 28...
28
#include <print.h>
28
#include <print.h>
29
#include <test.h>
29
#include <test.h>
30
 
30
 
31
#define BUFFER_SIZE 32
31
#define BUFFER_SIZE 32
32
 
32
 
33
void test_print1(void)
33
char * test_print1(void)
34
{
34
{
35
    int retval;
35
    int retval;
36
    unative_t nat = 0x12345678u;
36
    unative_t nat = 0x12345678u;
37
   
37
   
38
    char buffer[BUFFER_SIZE];
38
    char buffer[BUFFER_SIZE];
39
   
39
   
40
    printf(" Printf test \n");
-
 
41
   
-
 
42
    printf(" text 10.8s %*.*s \n", 5, 3, "text");
40
    printf(" text 10.8s %*.*s \n", 5, 3, "text");
43
    printf(" very long text 10.8s %10.8s \n", "very long text");
41
    printf(" very long text 10.8s %10.8s \n", "very long text");
44
    printf(" text 8.10s %8.10s \n", "text");
42
    printf(" text 8.10s %8.10s \n", "text");
45
    printf(" very long text 8.10s %8.10s \n", "very long text");
43
    printf(" very long text 8.10s %8.10s \n", "very long text");
46
 
44
 
Line 65... Line 63...
65
   
63
   
66
    printf("Print long text to %d char long buffer via snprintf.\n", BUFFER_SIZE);
64
    printf("Print long text to %d char long buffer via snprintf.\n", BUFFER_SIZE);
67
    retval = snprintf(buffer, BUFFER_SIZE, "Very long %s. This text`s length is more than %d. We are interested in the result.", "text" , BUFFER_SIZE);
65
    retval = snprintf(buffer, BUFFER_SIZE, "Very long %s. This text`s length is more than %d. We are interested in the result.", "text" , BUFFER_SIZE);
68
    printf("Result is: '%s', retval = %d\n", buffer, retval);
66
    printf("Result is: '%s', retval = %d\n", buffer, retval);
69
   
67
   
70
    return;
68
    return NULL;
71
}
69
}