File: SystemTest.c

package info (click to toggle)
monit 1%3A5.4-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,028 kB
  • sloc: ansic: 22,062; sh: 10,070; yacc: 2,700; lex: 821; makefile: 260
file content (43 lines) | stat: -rw-r--r-- 892 bytes parent folder | download
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
39
40
41
42
43
#include "Config.h"

#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <stdarg.h>

#include "Bootstrap.h"
#include "Str.h"
#include "system/System.h"
#include "Thread.h"

/**
 * System.c unity tests.
 */



int main(void) {

        Bootstrap(); // Need to initialize library
        
        printf("============> Start System Tests\n\n");

        printf("=> Test0: check error description\n");
        {
                const char *error;
                assert((error = System_getError(EINVAL)) != NULL);
                printf("\tEINVAL description: %s\n", error);
                errno = EINVAL;
                assert(Str_isEqual(System_getLastError(), error));

        }
        printf("=> Test0: OK\n\n");

        printf("============> System Tests: OK\n\n");

        return 0;
}