summaryrefslogtreecommitdiffstats
path: root/tests/TemporaryFile.h
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-06-12 13:16:36 -0700
committerChristopher Ferris <cferris@google.com>2014-06-12 13:16:36 -0700
commiteda26bc1ffc60dc722a375095b9de4fd86959a1d (patch)
tree42945943a50e5da2babb16bc05eaff7868ff3e36 /tests/TemporaryFile.h
parentb67a3c271616d7b2506ead15e97c6a840b5eb5a8 (diff)
downloadbionic-eda26bc1ffc60dc722a375095b9de4fd86959a1d.zip
bionic-eda26bc1ffc60dc722a375095b9de4fd86959a1d.tar.gz
bionic-eda26bc1ffc60dc722a375095b9de4fd86959a1d.tar.bz2
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
Diffstat (limited to 'tests/TemporaryFile.h')
-rw-r--r--tests/TemporaryFile.h6
1 files changed, 6 insertions, 0 deletions
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 @@ class GenericTemporaryFile {
unlink(filename);
}
+ void reopen() {
+ close(fd);
+ fd = open(filename, O_RDWR);
+ }
+
int fd;
char filename[1024];