| 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); |
nothing calls this directly
no test coverage detected