Skip to content

Commit ee48601

Browse files
testing
1 parent 17bf1af commit ee48601

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

google/cloud/odbc/integration_tests/odbc_driver_tests/connection_test.cc

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,23 +1617,16 @@ TEST(ConnectionTest, CheckTraceLogFileExist) {
16171617
#ifdef _WIN32
16181618
log_path = "C:\\b";
16191619
log_file = log_path + "\\odbcdriverforbigquery_0.log";
1620-
auto conn_str =
1621-
kDefaultConnectionString + ";LogPath=" + log_path + ";LogLevel=3";
1622-
#elif defined(__APPLE__)
1623-
log_path = "/tmp";
1624-
log_file = log_path + "/odbcdriverforbigquery_0.log";
1625-
auto conn_str =
1626-
kDefaultConnectionString + ";LogPath=" + log_path + ";LogLevel=3";
1620+
auto odbc_ini_path =k_trace_reg_path;
16271621
#else
16281622
log_path = "/tmp";
16291623
log_file = log_path + "/odbcdriverforbigquery_0.log";
1630-
16311624
auto odbc_ini = google::cloud::internal::GetEnv("GOOGLEBIGQUERYODBCINI");
16321625
auto odbc_ini_path = odbc_ini.value_or("");
1633-
UpdateTraceConfig(odbc_ini_path, log_path, "3");
1626+
#endif /* _WIN32 */
1627+
16341628
auto const& conn_str = kDefaultConnectionString;
1635-
#endif /* _WIN32 */
1636-
1629+
UpdateTraceConfig(odbc_ini_path, log_path, "3");
16371630
// Remove existing file
16381631
if (std::filesystem::exists(log_file)) {
16391632
std::filesystem::remove(std::filesystem::path(log_file));
@@ -1661,10 +1654,8 @@ TEST(ConnectionTest, CheckTraceLogFileExist) {
16611654
content.find("SQLFreeHandle:: DBC handle is free") != std::string::npos;
16621655
EXPECT_TRUE(contains_text);
16631656

1664-
#if defined(__linux__)
16651657
// Disable tracing for non windows
16661658
UpdateTraceConfig(odbc_ini_path, log_path, "0");
1667-
#endif /* defined(__linux__) */
16681659
}
16691660

16701661
#endif // BQ_DRIVER_INTEGRATION_TESTS

google/cloud/odbc/testing/odbc_utils/commons.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ bool const kIsWin32 = true;
5656
bool const kIsWin32 = false;
5757
#endif
5858

59+
#ifdef _WIN64
60+
// 64-bit
61+
inline std::string k_trace_reg_path =
62+
R"(SOFTWARE\\Google\\ODBC Driver for BigQuery)";
63+
#else
64+
// 32-bit
65+
inline std::string k_trace_reg_path =
66+
R"(SOFTWARE\\WOW6432Node\\Google\\ODBC Driver for BigQuery)";
67+
#endif // _WIN64
68+
5969
bool const kIsUnixODBC =
6070
google::cloud::internal::GetEnv("UNIXODBC_INSTALLED").value_or("false") ==
6171
"true";

0 commit comments

Comments
 (0)