Skip to content

Commit fef398c

Browse files
committed
checkers
1 parent 554eeb4 commit fef398c

9 files changed

Lines changed: 53 additions & 55 deletions

File tree

ci/gha/builds/windows-cmake-unit.sh

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ mapfile -t args < <(cmake::common_args "${CMAKE_OUT}")
3737
mapfile -t vcpkg_args < <(cmake::vcpkg_args)
3838
mapfile -t ctest_args < <(ctest::common_args)
3939

40-
4140
if [[ $# -gt 1 ]]; then
4241
args+=("-DCMAKE_BUILD_TYPE=${1}")
4342
shift
@@ -75,12 +74,12 @@ time {
7574

7675
TIMEFORMAT="==> 🕑 Unit tests done in %R seconds"
7776
time {
78-
io::run ctest \
79-
"${ctest_args[@]}" \
80-
--test-dir "${CMAKE_OUT}" \
81-
--timeout 300 \
82-
--output-on-failure \
83-
--parallel 2 \
84-
--force-new-ctest-process \
85-
--schedule-random
86-
}
77+
io::run ctest \
78+
"${ctest_args[@]}" \
79+
--test-dir "${CMAKE_OUT}" \
80+
--timeout 300 \
81+
--output-on-failure \
82+
--parallel 2 \
83+
--force-new-ctest-process \
84+
--schedule-random
85+
}

google/cloud/odbc/CMakeLists.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@ endif ()
6161
find_package(absl CONFIG REQUIRED)
6262

6363
if (ODBC_UNIT_TESTING)
64-
if (NOT MSVC)
65-
FetchContent_Declare(
66-
fuzztest
67-
URL "https://github.com/google/fuzztest/archive/refs/tags/2024-10-28.tar.gz"
68-
)
69-
set(FUZZTEST_USE_EXTERNAL_ABSL
70-
ON
71-
CACHE BOOL "" FORCE)
72-
set(FUZZTEST_USE_EXTERNAL_RE2
73-
ON
74-
CACHE BOOL "" FORCE)
75-
set(FUZZTEST_USE_EXTERNAL_GTEST
76-
ON
77-
CACHE BOOL "" FORCE)
78-
79-
FetchContent_MakeAvailable(fuzztest)
80-
else()
64+
if (NOT MSVC)
65+
FetchContent_Declare(
66+
fuzztest
67+
URL "https://github.com/google/fuzztest/archive/refs/tags/2024-10-28.tar.gz"
68+
)
69+
set(FUZZTEST_USE_EXTERNAL_ABSL
70+
ON
71+
CACHE BOOL "" FORCE)
72+
set(FUZZTEST_USE_EXTERNAL_RE2
73+
ON
74+
CACHE BOOL "" FORCE)
75+
set(FUZZTEST_USE_EXTERNAL_GTEST
76+
ON
77+
CACHE BOOL "" FORCE)
78+
79+
FetchContent_MakeAvailable(fuzztest)
80+
else ()
8181
message(STATUS "FuzzTest skipped: MSVC is not supported.")
82-
endif()
82+
endif ()
8383
endif ()
8484

8585
# Arrow is not supported on 32-bit systems
@@ -105,7 +105,7 @@ if (NOT google_cloud_cpp_bigquery_rest_FOUND OR NOT
105105
FetchContent_Declare(
106106
google-cloud-cpp
107107
URL https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v3.3.0.zip
108-
)
108+
)
109109
FetchContent_MakeAvailable(google-cloud-cpp)
110110
else ()
111111
find_package(google_cloud_cpp_bigquery CONFIG REQUIRED)

google/cloud/odbc/bq_driver/internal/driver_form_test.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ void MockOpenFileDialog(HWND hwnd, HWND h_edit, char const* simulated_path) {
7474

7575
TEST_F(DriverFormTest, TestUIOpens) {
7676
ASSERT_NE(form->GetHwnd(), nullptr) << "Form window should be created.";
77-
ASSERT_TRUE(IsWindow(form->GetHwnd()))
78-
<< "Form window should be visible.";
77+
ASSERT_TRUE(IsWindow(form->GetHwnd())) << "Form window should be visible.";
7978
}
8079

8180
TEST_F(DriverFormTest, TestButtonClickCancel) {
@@ -141,7 +140,7 @@ TEST_F(DriverFormTest, SetValuesValidinput) {
141140
}
142141

143142
TEST_F(DriverFormTest, SetValuesCheckcaseinsensitive) {
144-
ProcessMessages();
143+
ProcessMessages();
145144
Section attributes = {{"DSN", "test"},
146145
{"OAuthMechanISM", "0"},
147146
{"KeyFilePATH", "/path/to/key"},
@@ -208,8 +207,11 @@ TEST_F(DriverFormTest, TestConnectionWrongoauth) {
208207
auto status = DriverForm::TestODBCConnection(section);
209208
EXPECT_THAT(
210209
status,
211-
StatusRecIs(SQLStates::k_HY000(),
212-
HasSubstr("OAuthMechanism must be 'Service Authentication', 'Application Default Credentials', or 'External Account Authentication'.")));
210+
StatusRecIs(
211+
SQLStates::k_HY000(),
212+
HasSubstr(
213+
"OAuthMechanism must be 'Service Authentication', 'Application "
214+
"Default Credentials', or 'External Account Authentication'.")));
213215
}
214216
TEST_F(DriverFormTest, GetCatalogAndDatasetInvalidinputforcatalog) {
215217
auto result = DriverForm::GetCatalogAndDataset("Catalog", "", "");

google/cloud/odbc/bq_driver/internal/trace_utils.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ TraceOptions::CreateTraceOptionsFile(
281281

282282
std::string log_path;
283283
int log_level = 0;
284-
int log_file_count=0;
285-
int log_file_size=0;
284+
int log_file_count = 0;
285+
int log_file_size = 0;
286286
std::uint32_t max_threads = 8; // default max_threads
287287
for (auto const& s : trace_sections) {
288288
if (s.first == kLogLevel && !s.second.empty()) {

google/cloud/odbc/bq_driver/internal/trace_utils_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ TEST(GetAbslSeverity, InvalidAbslSeverity) {
7474

7575
TEST(GetLogFileWithIndex, CustomLogPath) {
7676
std::string log_path = "/custom/path/to/log/file";
77-
#ifdef _WIN32
77+
#ifdef _WIN32
7878
std::string expected =
7979
"/custom/path/to/log/file\\" + kLogTraceFileName + "_0.log";
80-
#else
80+
#else
8181
std::string expected =
8282
"/custom/path/to/log/file/" + kLogTraceFileName + "_0.log";
83-
#endif
83+
#endif
8484

8585
auto actual = GetLogFileWithIndex(log_path);
8686
EXPECT_EQ(actual, expected);

google/cloud/odbc/bq_driver/internal/utils.cc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,12 @@ StatusRecordOr<std::shared_ptr<Section>> GetSectionWin(
179179
std::string const& registry_key) {
180180
Section section;
181181
HKEY key_handle = nullptr;
182-
LONG status = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
183-
registry_key.c_str(),
184-
0, KEY_READ, &key_handle);
182+
LONG status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, registry_key.c_str(), 0,
183+
KEY_READ, &key_handle);
185184

186185
if (status != ERROR_SUCCESS) {
187-
status = RegOpenKeyEx(HKEY_CURRENT_USER,
188-
registry_key.c_str(),
189-
0, KEY_READ, &key_handle);
186+
status = RegOpenKeyEx(HKEY_CURRENT_USER, registry_key.c_str(), 0, KEY_READ,
187+
&key_handle);
190188
}
191189

192190
if (status != ERROR_SUCCESS) {
@@ -224,7 +222,7 @@ StatusRecordOr<std::shared_ptr<Section>> GetSectionWin(
224222
}
225223
}
226224
}
227-
if (key_handle) {
225+
if (key_handle) {
228226
RegCloseKey(key_handle);
229227
}
230228
return std::make_shared<Section>(section);

google/cloud/odbc/bq_driver/internal/utils_test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ TEST(StringUtils, JoinStartIndOutOfRange) {
144144

145145
TEST(Parsing, ParseConfig) {
146146
#ifndef _WIN32
147-
std::string test_data_path =
148-
google::cloud::internal::GetEnv("CPP_BIGQUERY_ODBC_DRIVER_TEST_DATA_PATH")
149-
.value_or("");
150-
auto sections_status = ParseConfig(test_data_path + "/sample.ini");
147+
std::string test_data_path =
148+
google::cloud::internal::GetEnv("CPP_BIGQUERY_ODBC_DRIVER_TEST_DATA_PATH")
149+
.value_or("");
150+
auto sections_status = ParseConfig(test_data_path + "/sample.ini");
151151
#else
152152

153153
#ifdef _WIN64

google/cloud/odbc/bq_driver/odbc_descriptor_test.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ namespace google::cloud::odbc_bq_driver {
2525
namespace {
2626
template <typename T>
2727
SQLPOINTER ToSqlPointer(T value) {
28-
static_assert(std::is_integral_v<T>,
29-
"Only integral types allowed");
28+
static_assert(std::is_integral_v<T>, "Only integral types allowed");
3029

3130
auto tmp = static_cast<intptr_t>(value);
3231

google/cloud/odbc/bq_driver/odbc_windows_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ TEST(ConfigDSNInternal, NullhandleSuccess) {
6767

6868
EXPECT_TRUE(section2->count("Driver"));
6969
EXPECT_TRUE(section2->count("DefaultDataset"));
70-
EXPECT_EQ(section2->at("DefaultDataset"), "");
71-
result = ConfigDSNInternal(hwnd_parent, ODBC_REMOVE_DSN,
72-
lpsz_driver, lpsz_attributes);
70+
EXPECT_EQ(section2->at("DefaultDataset"), "");
71+
result = ConfigDSNInternal(hwnd_parent, ODBC_REMOVE_DSN, lpsz_driver,
72+
lpsz_attributes);
7373
EXPECT_TRUE(result);
7474
}
7575

0 commit comments

Comments
 (0)