Update tests for new check library & osx
This commit is contained in:
@@ -31,6 +31,7 @@ static void logging_rm_subdir(void)
|
||||
}
|
||||
|
||||
START_TEST (test_logfile_location)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -62,9 +63,11 @@ START_TEST (test_logfile_location)
|
||||
rc = stat(FILE_NAME, &st);
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 380, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_delete_destination)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -110,9 +113,11 @@ START_TEST (test_logfile_delete_destination)
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 380, "was %ld", (long)st.st_size);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_no_location)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -140,9 +145,11 @@ START_TEST (test_logfile_no_location)
|
||||
rc = stat(FILE_NAME, &st);
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 52*2, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_loglevel_surpressed_dest)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -172,9 +179,11 @@ START_TEST (test_logfile_loglevel_surpressed_dest)
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
|
||||
fail_if(st.st_size != 0, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_loglevel_surpressed_module)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -204,9 +213,11 @@ START_TEST (test_logfile_loglevel_surpressed_module)
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
|
||||
fail_if(st.st_size != 0, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_reopen_files)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -247,9 +258,11 @@ START_TEST (test_logfile_reopen_files)
|
||||
fail_if(rc != 0, "2. stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 77, "was %ld", (long)st.st_size);//should only one line there now
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_remove_dest)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -301,9 +314,11 @@ START_TEST (test_logfile_remove_dest)
|
||||
fail_if(rc != 0, "2. stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 77*2, "was %ld", (long)st.st_size);//should be same size
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_full_filesystem)
|
||||
{
|
||||
//logging to a full filesystem shouldn't crash
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -331,9 +346,11 @@ START_TEST (test_logfile_full_filesystem)
|
||||
UC_LOGF(UC_LL_INFO, 0, "Lorum ipson %d", 1);
|
||||
}
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_invalid_file)
|
||||
{
|
||||
//check behavior when a log file cannot be opened
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -352,9 +369,11 @@ START_TEST (test_logfile_invalid_file)
|
||||
dest = uc_log_new_file("PATH/to/nonexisting.log", UC_LL_DEBUG, 1);
|
||||
fail_if(dest != NULL);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_invalid_file_after_reopen)
|
||||
{
|
||||
//check behavior when a log file cannot be re-opened
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -391,9 +410,11 @@ START_TEST (test_logfile_invalid_file_after_reopen)
|
||||
UC_LOGF(UC_LL_WARNING, 0, "Lorum ipson %d", 1);
|
||||
UC_LOGF(UC_LL_INFO, 0, "Lorum ipson %d", 1);
|
||||
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_raw)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -421,9 +442,11 @@ START_TEST (test_logfile_raw)
|
||||
rc = stat(FILE_NAME, &st);
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 14*2, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_logfile_dest_mask)
|
||||
{
|
||||
|
||||
struct UCLogModule m[] = {
|
||||
{
|
||||
@@ -467,9 +490,11 @@ START_TEST (test_logfile_dest_mask)
|
||||
rc = stat(FILE_NAME, &st);
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 14*2, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_loglevel_module_none)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -496,9 +521,11 @@ START_TEST (test_loglevel_module_none)
|
||||
rc = stat(FILE_NAME, &st);
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 0, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST (test_loglevel_dest_none)
|
||||
{
|
||||
|
||||
struct UCLogModule m = {
|
||||
.id = 0,
|
||||
@@ -525,6 +552,7 @@ START_TEST (test_loglevel_dest_none)
|
||||
rc = stat(FILE_NAME, &st);
|
||||
fail_if(rc != 0, "stat failed: %s", strerror(errno));
|
||||
fail_if(st.st_size != 0, "was %ld", (long)st.st_size);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user