Add google3 style logging to libbase.
ART already had a flavor of this, but it was specialized for their use
case a bit.
Note that the logging.* tests are currently disabled for the device
because there is no good way to capture the output of liblog. We can
make something that will execute logcat and then then scan the output,
but that's messy. Since we know it at least works on the host, we can
add better device tests later.
Change-Id: I47acd87a3312c0a5285b03f9c8dadef0c669f06a
diff --git a/base/file_test.cpp b/base/file_test.cpp
index 34b8755..fc48b32 100644
--- a/base/file_test.cpp
+++ b/base/file_test.cpp
@@ -24,29 +24,7 @@
#include <string>
-class TemporaryFile {
- public:
- TemporaryFile() {
- init("/data/local/tmp");
- if (fd == -1) {
- init("/tmp");
- }
- }
-
- ~TemporaryFile() {
- close(fd);
- unlink(filename);
- }
-
- int fd;
- char filename[1024];
-
- private:
- void init(const char* tmp_dir) {
- snprintf(filename, sizeof(filename), "%s/TemporaryFile-XXXXXX", tmp_dir);
- fd = mkstemp(filename);
- }
-};
+#include "test_utils.h"
TEST(file, ReadFileToString_ENOENT) {
std::string s("hello");