diff --git a/android/jni/TestRunner.cpp b/android/jni/TestRunner.cpp index 3f9feed41a..a6d430416c 100644 --- a/android/jni/TestRunner.cpp +++ b/android/jni/TestRunner.cpp @@ -21,7 +21,6 @@ // It currently just runs one test but that can be easily changed. #include -#include #include #include @@ -144,13 +143,14 @@ bool RunTests() { } } PSP_EndHostFrame(); - - std::ifstream expected(expectedFile.c_str(), std::ios_base::in); - if (!expected) { + + std::string expect_results; + if (!File::ReadFileToString(true, expectedFile.c_str(), expect_results)) { ERROR_LOG(SYSTEM, "Error opening expectedFile %s", expectedFile.c_str()); break; } + std::istringstream expected(expect_results); std::istringstream logoutput(output); int line = 0; diff --git a/headless/Compare.cpp b/headless/Compare.cpp index 223b65759f..72ed31e2cb 100644 --- a/headless/Compare.cpp +++ b/headless/Compare.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "headless/Compare.h" @@ -75,7 +74,7 @@ struct BufferedLineReader { const static int MAX_BUFFER = 5; const static int TEMP_BUFFER_SIZE = 32768; - BufferedLineReader(const std::string &data) : valid_(0), data_(data), pos_(0) { + BufferedLineReader(const std::string &data) : data_(data) { } void Fill() { @@ -135,7 +134,7 @@ struct BufferedLineReader { } protected: - BufferedLineReader() : valid_(0) { + BufferedLineReader() { } virtual bool HasMoreLines() { @@ -163,28 +162,10 @@ protected: return s.substr(0, p + 1); } - int valid_; + int valid_ = 0; std::string buffer_[MAX_BUFFER]; const std::string data_; - size_t pos_; -}; - -struct BufferedLineReaderFile : public BufferedLineReader { - BufferedLineReaderFile(std::ifstream &in) : BufferedLineReader(), in_(in) { - } - -protected: - virtual bool HasMoreLines() { - return !in_.eof(); - } - - virtual std::string ReadLine() { - char temp[TEMP_BUFFER_SIZE]; - in_.getline(temp, TEMP_BUFFER_SIZE); - return temp; - } - - std::ifstream &in_; + size_t pos_ = 0; }; std::string ExpectedFromFilename(const std::string &bootFilename) {