Skip to contentSkip to conversation

linux-user/mmap: Testsuite + bugfixes

PATCH New Edgar E. Iglesias 1 participant 1 message Feb 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user/mmap: Testsuite + bugfixes

Hi again,

I spent some more time creating more mmap test-cases and managed to trig a few more bugs. Luckily, most of them were straight forward to fix. A few are related to the funny semantics of MAP_FILE mmaps beyond EOF.
This posts elaborates a bit more on the issue:
http://lists.gnu.org/archive/html/qemu-devel/2008-01/msg00163.html

Tested on my intel centrino duo as host, for CRIS, MIPS and i386 targets. Used the -p flag to simulate 8K, 16K and 32K page-sizes.

To run the tests for i386 just do a 'make -C tests test-mmap'.

I hope this is helpful to somebody.

Best regards

Signature · 2 lines
Edgar E. Iglesias
Axis Communications AB
configure +1 -0
index bbda3f7..3df08ab 100755
@@ -1244,6 +1244,7 @@ if test "$source_path_used" = "yes" ; then
     DIRS="tests tests/cris slirp audio"
     FILES="Makefile tests/Makefile"
     FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit"
+    FILES="$FILES tests/test-mmap.c"
     for dir in $DIRS ; do
             mkdir -p $dir
     done
linux-user/mmap.c +51 -8

109 lines not on this page · raw message

tests/Makefile +9 -0
index 1775be8..f8e15e4 100644
@@ -51,6 +51,15 @@ ifeq ($(ARCH),i386)
 	@if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi
 endif
 
+.PHONY: test-mmap
+test-mmap: test-mmap.c
+	$(CC) $(CFLAGS) -Wall -static -O2 $(LDFLAGS) -o $@ $<
+	./test-mmap
+	$(QEMU) ./test-mmap
+	$(QEMU) -p 8192 ./test-mmap 8192
+	$(QEMU) -p 16384 ./test-mmap 16384
+	$(QEMU) -p 32768 ./test-mmap 32768
+
 # generic Linux and CPU test
 linux-test: linux-test.c
 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
tests/test-mmap.c new file +377 -0

377 lines not on this page · raw message