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
This commit is contained in:
Christopher Ferris
2014-06-12 13:16:36 -07:00
parent b67a3c2716
commit eda26bc1ff
2 changed files with 156 additions and 6 deletions

View File

@@ -14,6 +14,7 @@
* limitations under the License.
*/
#include <fcntl.h>
#include <unistd.h>
template<int (*mk_fn)(char*)>
@@ -39,6 +40,11 @@ class GenericTemporaryFile {
unlink(filename);
}
void reopen() {
close(fd);
fd = open(filename, O_RDWR);
}
int fd;
char filename[1024];