mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
Trivial readability changes in mmap unit tests
This commit is contained in:
parent
f90406cb01
commit
3c5a3b33e8
1 changed files with 3 additions and 3 deletions
|
@ -1065,8 +1065,6 @@ test_util_mmap(void)
|
||||||
test_assert(! mapping);
|
test_assert(! mapping);
|
||||||
|
|
||||||
write_str_to_file(fname1, "Short file.", 1);
|
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);
|
mapping = tor_mmap_file(fname1);
|
||||||
test_assert(mapping);
|
test_assert(mapping);
|
||||||
|
@ -1093,9 +1091,10 @@ test_util_mmap(void)
|
||||||
|
|
||||||
/* Make sure that we fail to map a no-longer-existent file. */
|
/* Make sure that we fail to map a no-longer-existent file. */
|
||||||
mapping = tor_mmap_file(fname1);
|
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 */
|
/* 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);
|
mapping = tor_mmap_file(fname2);
|
||||||
test_assert(mapping);
|
test_assert(mapping);
|
||||||
test_eq(mapping->size, buflen);
|
test_eq(mapping->size, buflen);
|
||||||
|
@ -1104,6 +1103,7 @@ test_util_mmap(void)
|
||||||
mapping = NULL;
|
mapping = NULL;
|
||||||
|
|
||||||
/* Now try a big aligned file. */
|
/* Now try a big aligned file. */
|
||||||
|
write_bytes_to_file(fname3, buf, 16384, 1);
|
||||||
mapping = tor_mmap_file(fname3);
|
mapping = tor_mmap_file(fname3);
|
||||||
test_assert(mapping);
|
test_assert(mapping);
|
||||||
test_eq(mapping->size, 16384);
|
test_eq(mapping->size, 16384);
|
||||||
|
|
Loading…
Add table
Reference in a new issue