diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-03-31 11:40:00 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-31 11:40:00 -0400 |
commit | 8e94d5f22ee863d57a76233cd75099d522bd38c7 (patch) | |
tree | 6a1645e7984c49a6f14eae349979d9cc41a3cbe1 /src/test | |
parent | 7cdb50e86604c33cfbf5e94ab56629f0bf92b804 (diff) | |
download | tor-8e94d5f22ee863d57a76233cd75099d522bd38c7.tar.gz tor-8e94d5f22ee863d57a76233cd75099d522bd38c7.zip |
Check return values for tor_munmap_file() in unit tests
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_util.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 9104088c90..a471b8eb19 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1577,14 +1577,14 @@ test_util_mmap(void) test_eq(mapping->size, strlen("Short file.")); test_streq(mapping->data, "Short file."); #ifdef _WIN32 - tor_munmap_file(mapping); + tt_int_op(0, ==, tor_munmap_file(mapping)); mapping = NULL; test_assert(unlink(fname1) == 0); #else /* make sure we can unlink. */ test_assert(unlink(fname1) == 0); test_streq(mapping->data, "Short file."); - tor_munmap_file(mapping); + tt_int_op(0, ==, tor_munmap_file(mapping)); mapping = NULL; #endif @@ -1605,7 +1605,7 @@ test_util_mmap(void) test_assert(mapping); test_eq(mapping->size, buflen); test_memeq(mapping->data, buf, buflen); - tor_munmap_file(mapping); + tt_int_op(0, ==, tor_munmap_file(mapping)); mapping = NULL; /* Now try a big aligned file. */ @@ -1614,7 +1614,7 @@ test_util_mmap(void) test_assert(mapping); test_eq(mapping->size, 16384); test_memeq(mapping->data, buf, 16384); - tor_munmap_file(mapping); + tt_int_op(0, ==, tor_munmap_file(mapping)); mapping = NULL; done: @@ -1627,8 +1627,7 @@ test_util_mmap(void) tor_free(fname3); tor_free(buf); - if (mapping) - tor_munmap_file(mapping); + tor_munmap_file(mapping); } /** Run unit tests for escaping/unescaping data for use by controllers. */ |