1 | #pragma once |
2 | |
3 | #ifdef _MSC_VER |
4 | // these break enum.hpp otherwise |
5 | #undef DELETE |
6 | #undef DEFAULT |
7 | #undef EXISTS |
8 | #undef IN |
9 | // this breaks file_system.cpp otherwise |
10 | #undef CreateDirectory |
11 | #undef RemoveDirectory |
12 | #endif |
13 | |
14 | #include "compare_result.hpp" |
15 | #include "duckdb.hpp" |
16 | #include "duckdb/common/string_util.hpp" |
17 | #include "duckdb/common/types.hpp" |
18 | |
19 | namespace duckdb { |
20 | |
21 | void DeleteDatabase(string path); |
22 | void TestDeleteDirectory(string path); |
23 | void TestCreateDirectory(string path); |
24 | void TestDeleteFile(string path); |
25 | string TestCreatePath(string suffix); |
26 | unique_ptr<DBConfig> GetTestConfig(); |
27 | |
28 | string GetCSVPath(); |
29 | void WriteCSV(string path, const char *csv); |
30 | void WriteBinary(string path, const uint8_t *data, uint64_t length); |
31 | |
32 | bool NO_FAIL(QueryResult &result); |
33 | bool NO_FAIL(unique_ptr<QueryResult> result); |
34 | |
35 | #define REQUIRE_NO_FAIL(result) REQUIRE(NO_FAIL((result))) |
36 | #define REQUIRE_FAIL(result) REQUIRE(!(result)->success) |
37 | |
38 | #define COMPARE_CSV(result, csv, header) \ |
39 | { \ |
40 | auto res = compare_csv(*result, csv, header); \ |
41 | if (!res.empty()) \ |
42 | FAIL(res); \ |
43 | } |
44 | |
45 | } // namespace duckdb |
46 | |