summaryrefslogtreecommitdiff
path: root/examples/utest/testcases/posix/stdio_h/functions/putchar_tc.c
blob: 70c24520c676828dbeaf1043650801d79c8f6e3d (plain)
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
#include <stdio.h>

static int putchar_entry(void)
{
    char data[] = "putchar testcase\n";
    int i = 0;
    for(;i < sizeof(data);i++)
    {
        putchar(data[i]);
    }
    fflush(stdout);
    return 0;
}

#include <utest.h>
static void test_putchar(void)
{
    uassert_int_equal(putchar_entry(), 0);
}
static void testcase(void)
{
    UTEST_UNIT_RUN(test_putchar);
}
UTEST_TC_EXPORT(testcase, "rtt_posix_testcase.stdio_h."__FILE__, RT_NULL, RT_NULL, 10);