diff options
author | Esteban Manchado Velázquez <emanchado@demiurgo.org> | 2012-02-06 19:45:52 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-03-08 20:49:23 -0500 |
commit | 3c5a3b33e824ce50147be5171eaa75f93c8ae968 (patch) | |
tree | 592f876329320c3940da9a9ca74ff9a43f124ae5 /src/test/test_util.c | |
parent | f90406cb01337ca0a411ed145441d2eceb29b8b4 (diff) | |
download | tor-3c5a3b33e824ce50147be5171eaa75f93c8ae968.tar.gz tor-3c5a3b33e824ce50147be5171eaa75f93c8ae968.zip |
Trivial readability changes in mmap unit tests
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r-- | src/test/test_util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c index 8177c8c106..ee4158431e 100644 --- a/src/test/test_util.c +++ b/src/test/test_util.c @@ -1065,8 +1065,6 @@ test_util_mmap(void) test_assert(! mapping); write_str_to_file(fname1, "Short file.", 1); - write_bytes_to_file(fname2, buf, buflen, 1); - write_bytes_to_file(fname3, buf, 16384, 1); mapping = tor_mmap_file(fname1); test_assert(mapping); @@ -1093,9 +1091,10 @@ test_util_mmap(void) /* Make sure that we fail to map a no-longer-existent file. */ mapping = tor_mmap_file(fname1); - test_assert(mapping == NULL); + test_assert(! mapping); /* Now try a big file that stretches across a few pages and isn't aligned */ + write_bytes_to_file(fname2, buf, buflen, 1); mapping = tor_mmap_file(fname2); test_assert(mapping); test_eq(mapping->size, buflen); @@ -1104,6 +1103,7 @@ test_util_mmap(void) mapping = NULL; /* Now try a big aligned file. */ + write_bytes_to_file(fname3, buf, 16384, 1); mapping = tor_mmap_file(fname3); test_assert(mapping); test_eq(mapping->size, 16384); |