-
Notifications
You must be signed in to change notification settings - Fork 0
Adjust tests for MacOS #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,8 @@ void GetInfo(SQLHDBC connection, SQLUSMALLINT info_type, SQLWCHAR* value, | |
| } | ||
| } // namespace | ||
|
|
||
| // Test disabled until we resolve bus error on MacOS | ||
| #ifdef DISABLE_TEST | ||
|
Comment on lines
+70
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you raise an internal Jira for this? If we plan to export this change to the Arrow repo, we need to raise a GitHub issue for this as well.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoTruncation) { | ||
| static constexpr int info_len = 1; | ||
| SQLWCHAR value[info_len] = L""; | ||
|
|
@@ -79,6 +81,7 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoTruncation) { | |
| VerifyOdbcErrorState(SQL_HANDLE_DBC, this->conn, kErrorState01004); | ||
| EXPECT_GT(message_length, 0); | ||
| } | ||
| #endif | ||
|
|
||
| // Driver Information | ||
|
|
||
|
|
@@ -319,7 +322,11 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoOdbcVer) { | |
| SQLWCHAR value[kOdbcBufferSize] = L""; | ||
| GetInfo(this->conn, SQL_ODBC_VER, value); | ||
|
|
||
| #ifdef __APPLE__ | ||
| EXPECT_STREQ(static_cast<const SQLWCHAR*>(L"03.52.0000"), value); | ||
| #else | ||
| EXPECT_STREQ(static_cast<const SQLWCHAR*>(L"03.80.0000"), value); | ||
| #endif // __APPLE__ | ||
| } | ||
|
|
||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoParamArrayRowCounts) { | ||
|
|
@@ -785,6 +792,8 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoIntegrity) { | |
| EXPECT_STREQ(static_cast<const SQLWCHAR*>(L"N"), value); | ||
| } | ||
|
|
||
| // Test disabled until we resolve bus error on MacOS | ||
| #ifdef DISABLE_TEST | ||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoKeywords) { | ||
| // Keyword strings can require 5000 buffer length | ||
| static constexpr int info_len = kOdbcBufferSize * 5; | ||
|
|
@@ -793,6 +802,7 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoKeywords) { | |
|
|
||
| EXPECT_GT(wcslen(value), 0); | ||
| } | ||
| #endif | ||
|
|
||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoLikeEscapeClause) { | ||
| SQLWCHAR value[kOdbcBufferSize] = L""; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, is this a bug that only occurs on mac and not Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for iterating through all the columns happens inside the
while (sqlite3_step(schema_statement->GetSqlite3Stmt()) == SQLITE_ROW)loop. On Windows we can go through this loop multiple times which is why the loop was nested inside another loop iterating through the tables. But on MacOS, this loop will only run all the way through once. So I rewrote this logic to only go through the loop once using a map to sort out which columns belong to which table. This new logic works for both Windows and MacOS.