-
Notifications
You must be signed in to change notification settings - Fork 0
Fix tests on Linux #168
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
Fix tests on Linux #168
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 |
|---|---|---|
|
|
@@ -143,6 +143,9 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDataSourceName) { | |
| } | ||
|
|
||
| #ifdef SQL_DRIVER_AWARE_POOLING_SUPPORTED | ||
| // GH-49782: TODO Disabled on Linux until SQL_DRIVER_AWARE_POOLING_SUPPORTED is | ||
| // implemented in the driver. | ||
| # ifndef __linux__ | ||
|
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. Let's add comment I assume this is the reason we are disabling this test for Linux
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. I've looked into this a bit more and discovered that (unlike the Windows and Mac driver managers) unixODBC hands off this attribute to the driver. But our driver does not have any |
||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverAwarePoolingSupported) { | ||
| // According to Microsoft documentation, ODBC driver does not need to implement | ||
| // SQL_DRIVER_AWARE_POOLING_SUPPORTED and the Driver Manager will ignore the | ||
|
|
@@ -153,7 +156,8 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverAwarePoolingSupported) { | |
|
|
||
| EXPECT_EQ(static_cast<SQLUINTEGER>(SQL_DRIVER_AWARE_POOLING_NOT_CAPABLE), value); | ||
| } | ||
| #endif | ||
| # endif // __linux__ | ||
| #endif // SQL_DRIVER_AWARE_POOLING_SUPPORTED | ||
|
|
||
| // These information types are implemented by the Driver Manager alone. | ||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHdbc) { | ||
|
|
@@ -329,9 +333,11 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoOdbcVer) { | |
|
|
||
| std::wstring result = ConvertToWString(value); | ||
|
|
||
| #ifdef __APPLE__ | ||
| #if defined(__APPLE__) | ||
| EXPECT_EQ(std::wstring(L"03.52.0000"), result); | ||
| #else | ||
| #elif defined(__linux__) | ||
| EXPECT_EQ(std::wstring(L"03.52"), result); | ||
| #else // WINDOWS | ||
| EXPECT_EQ(std::wstring(L"03.80.0000"), result); | ||
| #endif // __APPLE__ | ||
| } | ||
|
|
@@ -370,7 +376,8 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoServerName) { | |
| SQLWCHAR value[kOdbcBufferSize] = {}; | ||
| GetInfoSQLWCHAR(conn, SQL_SERVER_NAME, value); | ||
|
|
||
| EXPECT_GT(wcslen(reinterpret_cast<wchar_t*>(value)), 0); | ||
| std::wstring result = ConvertToWString(value); | ||
| EXPECT_GT(result.length(), 0); | ||
| } | ||
|
|
||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoStaticCursorAttributes1) { | ||
|
|
@@ -401,14 +408,16 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDbmsName) { | |
| SQLWCHAR value[kOdbcBufferSize] = {}; | ||
| GetInfoSQLWCHAR(conn, SQL_DBMS_NAME, value); | ||
|
|
||
| EXPECT_GT(wcslen(reinterpret_cast<wchar_t*>(value)), 0); | ||
| std::wstring result = ConvertToWString(value); | ||
| EXPECT_GT(result.length(), 0); | ||
| } | ||
|
|
||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDbmsVer) { | ||
| SQLWCHAR value[kOdbcBufferSize] = {}; | ||
| GetInfoSQLWCHAR(conn, SQL_DBMS_VER, value); | ||
|
|
||
| EXPECT_GT(wcslen(reinterpret_cast<wchar_t*>(value)), 0); | ||
| std::wstring result = ConvertToWString(value); | ||
| EXPECT_GT(result.length(), 0); | ||
| } | ||
|
|
||
| // Data Source Information | ||
|
|
@@ -614,7 +623,7 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAlterTable) { | |
| TYPED_TEST(ConnectionInfoHandleTest, TestSQLGetInfoCatalogLocation) { | ||
| // GH-49482 TODO: resolve inconsitent return value for SQL_CATALOG_LOCATION and change | ||
| // test type to `ConnectionInfoTest` | ||
| this->ConnectWithString(this->GetConnectionString()); | ||
| this->ConnectWithString(this->GetConnectionString(), conn); | ||
|
|
||
| SQLUSMALLINT value; | ||
| GetInfo(conn, SQL_CATALOG_LOCATION, &value); | ||
|
|
@@ -750,7 +759,7 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDropDomain) { | |
| TYPED_TEST(ConnectionInfoHandleTest, TestSQLGetInfoDropSchema) { | ||
| // GH-49482 TODO: resolve inconsitent return value for SQL_DROP_SCHEMA and change test | ||
| // type to `ConnectionInfoTest` | ||
| this->ConnectWithString(this->GetConnectionString()); | ||
| this->ConnectWithString(this->GetConnectionString(), conn); | ||
|
|
||
| SQLUINTEGER value; | ||
| GetInfo(conn, SQL_DROP_SCHEMA, &value); | ||
|
|
@@ -764,7 +773,7 @@ TYPED_TEST(ConnectionInfoHandleTest, TestSQLGetInfoDropSchema) { | |
| TYPED_TEST(ConnectionInfoHandleTest, TestSQLGetInfoDropTable) { | ||
| // GH-49482 TODO: resolve inconsitent return value for SQL_DROP_TABLE and change test | ||
| // type to `ConnectionInfoTest` | ||
| this->ConnectWithString(this->GetConnectionString()); | ||
| this->ConnectWithString(this->GetConnectionString(), conn); | ||
|
|
||
| SQLUINTEGER value; | ||
| GetInfo(conn, SQL_DROP_TABLE, &value); | ||
|
|
@@ -848,7 +857,8 @@ TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoKeywords) { | |
| SQLWCHAR value[info_len] = {}; | ||
| GetInfoSQLWCHAR(conn, SQL_KEYWORDS, value, info_len); | ||
|
|
||
| EXPECT_GT(wcslen(reinterpret_cast<wchar_t*>(value)), 0); | ||
| std::wstring result = ConvertToWString(value, -1, info_len); | ||
| EXPECT_GT(result.length(), 0); | ||
| } | ||
|
|
||
| TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoLikeEscapeClause) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.