Add/Remove mmap tests.
Remove the incorrect tests that use a negative offset for mmap without
a fd.
Add a small set of tests for mmap.
Bug: 15436969
Change-Id: Id537d33cd4cdc26dee6cdfa9bf9cf35754bce335
diff --git a/tests/TemporaryFile.h b/tests/TemporaryFile.h
index a7b13b0..c4ee2d5 100644
--- a/tests/TemporaryFile.h
+++ b/tests/TemporaryFile.h
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <fcntl.h>
#include <unistd.h>
template<int (*mk_fn)(char*)>
@@ -39,6 +40,11 @@
unlink(filename);
}
+ void reopen() {
+ close(fd);
+ fd = open(filename, O_RDWR);
+ }
+
int fd;
char filename[1024];