summaryrefslogtreecommitdiffstats
path: root/runtime/common_runtime_test.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-05-02 14:25:12 -0700
committerAndreas Gampe <agampe@google.com>2014-05-02 14:25:12 -0700
commitb40c6a768aa8df4774d2a8c3ac7045237cc748cd (patch)
treecbfd1265e0e1b43345d97727d21d0e7e5a9859d8 /runtime/common_runtime_test.h
parent1dbbbf6090274ebae6809fdb340c166bb34e09c2 (diff)
downloadart-b40c6a768aa8df4774d2a8c3ac7045237cc748cd.zip
art-b40c6a768aa8df4774d2a8c3ac7045237cc748cd.tar.gz
art-b40c6a768aa8df4774d2a8c3ac7045237cc748cd.tar.bz2
ART: Fix assembler_test to use ScratchFile
This removes a warning about tmpnam usage. Also add an assertion to ScratchFile about ANDROID_DATA being set, which it relies on for the temp directory. Change-Id: I1202f92e48e61492f0ed3ac36ff44fde34dbb0e1
Diffstat (limited to 'runtime/common_runtime_test.h')
-rw-r--r--runtime/common_runtime_test.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/common_runtime_test.h b/runtime/common_runtime_test.h
index 723e32c..79d3690 100644
--- a/runtime/common_runtime_test.h
+++ b/runtime/common_runtime_test.h
@@ -57,6 +57,9 @@ namespace art {
class ScratchFile {
public:
ScratchFile() {
+ // ANDROID_DATA needs to be set
+ CHECK_NE(static_cast<char*>(nullptr), getenv("ANDROID_DATA")) <<
+ "Are you subclassing RuntimeTest?";
filename_ = getenv("ANDROID_DATA");
filename_ += "/TmpFile-XXXXXX";
int fd = mkstemp(&filename_[0]);