test/logging_tests.c

changeset 185
a48428642b4e
parent 177
11ad03783baf
child 186
05559c99010d
     1.1 --- a/test/logging_tests.c	Mon Jul 21 13:18:32 2014 +0200
     1.2 +++ b/test/logging_tests.c	Mon Jul 28 14:36:25 2014 +0200
     1.3 @@ -50,16 +50,16 @@
     1.4          "incorrect number of registered log levels");
     1.5  
     1.6      int level = UCX_LOGGER_ERROR;
     1.7 -    UCX_TEST_ASSERT(strcmp(ucx_map_int_get(logger->levels, level),
     1.8 +    UCX_TEST_ASSERT(strcmp((char*)ucx_map_int_get(logger->levels, level),
     1.9          "[ERROR]") == 0, "invalid error level");
    1.10      level = UCX_LOGGER_WARN;
    1.11 -    UCX_TEST_ASSERT(strcmp(ucx_map_int_get(logger->levels, level),
    1.12 +    UCX_TEST_ASSERT(strcmp((char*)ucx_map_int_get(logger->levels, level),
    1.13          "[WARNING]") == 0, "invalid warning level");
    1.14      level = UCX_LOGGER_INFO;
    1.15 -    UCX_TEST_ASSERT(strcmp(ucx_map_int_get(logger->levels, level),
    1.16 +    UCX_TEST_ASSERT(strcmp((char*)ucx_map_int_get(logger->levels, level),
    1.17          "[INFO]") == 0, "invalid info level");
    1.18      level = UCX_LOGGER_TRACE;
    1.19 -    UCX_TEST_ASSERT(strcmp(ucx_map_int_get(logger->levels, level),
    1.20 +    UCX_TEST_ASSERT(strcmp((char*)ucx_map_int_get(logger->levels, level),
    1.21          "[TRACE]") == 0, "invalid trace level");
    1.22  
    1.23      UCX_TEST_END
    1.24 @@ -75,7 +75,7 @@
    1.25  
    1.26      UcxLogger *logger = ucx_logger_new(stream,
    1.27              UCX_LOGGER_INFO, UCX_LOGGER_SOURCE | UCX_LOGGER_LEVEL);
    1.28 -    logger->dateformat = "%F:";
    1.29 +    logger->dateformat = (char*) "%F:";
    1.30      
    1.31      UCX_TEST_BEGIN
    1.32      const uint line1 = __LINE__; ucx_logger_info(logger, "allright");
    1.33 @@ -92,7 +92,7 @@
    1.34      size_t r = fread(buffer, 1, 100, stream);
    1.35      
    1.36      const size_t expected_length = 87;
    1.37 -    char expected[expected_length+1];
    1.38 +    char expected[88];
    1.39      snprintf(expected, expected_length+1,
    1.40          "[INFO] logging_tests.c:%u - allright\n"
    1.41          "[ERROR] %slogging_tests.c:%u - error 42!\n", line1, timestr, line2);

mercurial