I had a standalone program that performed these tests back when I changed
mmap() to be stricter about checking for invalid arguments a while back.
This just incorporates them into the standard mmap test.
Details
Run the test.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
What about mmap(..., fd = open("dev/zero"), ...)?
Is MAP_SHARED allowed in this case?
tests/sys/vm/mmap_test.c | ||
---|---|---|
110 ↗ | (On Diff #7573) | No unmap ? If not needed, why freeing str ? |
Currently MAP_SHARED is accepted with that, though it is actually a private mapping due to /dev/zero's special nature.
tests/sys/vm/mmap_test.c | ||
---|---|---|
110 ↗ | (On Diff #7573) | Humm, I could actually drop the va_args thing entirely since all the tests don't pass any args. |
John, I probably should have asked this question first. What are you looking for from kib@ and me, i.e., just to verify that the proposed tests are correct, or suggest additional tests, or ... ?
Partly it's an FYI, but primarily verifying that this set of tests looks correct. I'm certainly open to suggestions for more test cases as well.
Sean Bruno has run into a regression with my fo_mmap() change where mmap of /dev/zero is failing under qemu. I have a follow-on change to add some simple /dev/zero tests as well. Unfortunately those work fine normally so I haven't been able to track down what Sean is running into, but adding a test for whatever that bug turns out to be was my motivation for converting the existing mmap_test.c to ATF. Subsequent to converting it, I noticed I had a standalone test program that contained these tests lying around from before and thought I would add it as well.
LGTM
head/tests/sys/vm/mmap_test.c | ||
---|---|---|
95–107 | There are a couple other macros that could be used here, like ATF_CHECK_ERRNO, but I admit that it overloads ATF_CHECK_EQ as well for little/no benefit :/. |