13 UCX_TEST_BEGIN |
13 UCX_TEST_BEGIN |
14 ucx_logger_info(logger, ST("[INFO:] allright\n")); |
14 ucx_logger_info(logger, ST("[INFO:] allright\n")); |
15 ucx_logger_trace(logger, ST("[TRACE:] dont log this!\n")); |
15 ucx_logger_trace(logger, ST("[TRACE:] dont log this!\n")); |
16 ucx_logger_error(logger, ST("[ERROR:] error!\n")); |
16 ucx_logger_error(logger, ST("[ERROR:] error!\n")); |
17 fseek(stream, 0, SEEK_SET); |
17 fseek(stream, 0, SEEK_SET); |
18 fread(buffer, 1, 100, stream); |
18 int r = fread(buffer, 1, 100, stream); |
19 |
19 |
20 UCX_TEST_ASSERT(strncmp(buffer, |
20 UCX_TEST_ASSERT(r == 33 && strncmp(buffer, |
21 "[INFO:] allright\n[ERROR:] error!\n", 33) == 0, "incorrect logs"); |
21 "[INFO:] allright\n[ERROR:] error!\n", 33) == 0, "incorrect logs"); |
22 |
22 |
23 UCX_TEST_END |
23 UCX_TEST_END |
24 |
24 |
25 free(logger); |
25 free(logger); |