MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetTestDirectory

Method GetTestDirectory

src/leveldb/util/env_windows.cc:630–649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628 }
629
630 Status GetTestDirectory(std::string* result) override {
631 const char* env = getenv("TEST_TMPDIR");
632 if (env && env[0] != '\0') {
633 *result = env;
634 return Status::OK();
635 }
636
637 wchar_t wtmp_path[MAX_PATH];
638 if (!GetTempPathW(ARRAYSIZE(wtmp_path), wtmp_path)) {
639 return WindowsError("GetTempPath", ::GetLastError());
640 }
641 std::string tmp_path = toUtf8(std::wstring(wtmp_path));
642 std::stringstream ss;
643 ss << tmp_path << "leveldbtest-" << std::this_thread::get_id();
644 *result = ss.str();
645
646 // Directory may already exist
647 CreateDir(*result);
648 return Status::OK();
649 }
650
651 Status NewLogger(const std::string& filename, Logger** result) override {
652 auto wFilename = toUtf16(filename);

Callers

nothing calls this directly

Calls 4

OKFunction · 0.85
WindowsErrorFunction · 0.85
CreateDirFunction · 0.85
strMethod · 0.80

Tested by

no test coverage detected