1 #ifndef __XAO_TESTUTILS_HXX__
2 #define __XAO_TESTUTILS_HXX__
12 static std::string getTestFilePath(const std::string& fileName)
14 std::string dataDir = getenv("GEOM_SRC_DIR");
15 dataDir += "/src/XAO/tests/data/" + fileName;
19 static char* readTextFile(const std::string& filePath)
23 rstr.open(filePath.c_str());
24 rstr.seekg(0, rstr.end); // go to the end
25 length = rstr.tellg(); // report location (this is the length)
26 rstr.seekg(0, rstr.beg); // go back to the beginning
27 char* txt = new char[length]; // allocate memory for a buffer of appropriate dimension
28 rstr.read(txt, length); // read the whole file into the buffer
36 #endif /* __XAO_TESTUTILS_HXX__ */