Implementation of connectivity abstraction feature-Ubutu v0.1
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / libcoap-4.1.1 / tests / testdriver.c
1 #include <stdio.h>
2
3 #include <CUnit/CUnit.h>
4 #include <CUnit/Basic.h>
5
6 /* #include <coap.h> */
7
8 #include "test_uri.h"
9 #include "test_options.h"
10 #include "test_pdu.h"
11 #include "test_error_response.h"
12 #include "test_sendqueue.h"
13 #include "test_wellknown.h"
14
15 int main(int argc, char **argv)
16 {
17     CU_ErrorCode result;
18     CU_BasicRunMode run_mode = CU_BRM_VERBOSE;
19
20     if (CU_initialize_registry() != CUE_SUCCESS)
21     {
22         fprintf(stderr, "E: test framework initialization failed\n");
23         return -2;
24     }
25
26     t_init_uri_tests();
27     t_init_option_tests();
28     t_init_pdu_tests();
29     t_init_error_response_tests();
30     t_init_sendqueue_tests();
31     t_init_wellknown_tests();
32
33     CU_basic_set_mode(run_mode);
34     result = CU_basic_run_tests();
35
36     CU_cleanup_registry();
37
38     printf("\n\nknown bugs:\n");
39     printf("\t- Test: t_parse_uri5 ... FAILED\n"
40             "\t    1. test_uri.c:109  - CU_FAIL(\"invalid port not detected\")\n");
41     printf("\t- Test: t_parse_uri12 ... FAILED\n"
42             "\t    1. test_uri.c:301  - result == 4\n"
43             "\t    2. test_uri.c:302  - buflen == sizeof(uricheckbuf)\n"
44             "\t    3. test_uri.c:303  - CU_ASSERT_NSTRING_EQUAL(buf,uricheckbuf,buflen)\n"
45             "\t    4. test_uri.c:309  - buflen == sizeof(querycheckbuf)\n"
46             "\t    5. test_uri.c:310  - CU_ASSERT_NSTRING_EQUAL(buf,querycheckbuf,buflen)\n");
47     printf(
48             "\t- Test: t_error_response8 ... FAILED\n"
49                     "\t    1. test_error_response.c:310  - response->length == sizeof(teststr)\n"
50                     "\t    2. test_error_response.c:316  - memcmp(response->hdr, teststr, sizeof(teststr)) == 0\n");
51
52     return result;
53 }