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
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 @@
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]);