Get test suite building on Linux#165
Conversation
fc15dae to
4350de9
Compare
45997d2 to
319275e
Compare
| expected_date_time_sub, // expected_date_time_sub | ||
| 0, // expected_octet_char_length |
There was a problem hiding this comment.
For consistency and if this won't break the build, could we pass 0 directly for expected_date_time_sub here and remove expected_date_time_sub = 0?
I see value 0 is accepted for expected_octet_char_length, although expected_octet_char_length is type SQLINTEGER and expected_date_time_sub is SQLSMALLINT; their types are different.
| SQLWCHAR input_str[] = L"SELECT * FROM mytable WHERE id == 1"; | ||
| SQLINTEGER input_char_len = static_cast<SQLINTEGER>(wcslen(input_str)); | ||
| ASSIGN_SQLWCHAR_ARR(input_str, L"SELECT * FROM mytable WHERE id == 1"); | ||
| SQLINTEGER input_char_len = std::wcslen((const wchar_t*)input_str); |
There was a problem hiding this comment.
Let's use c++ style casting (I think it's const_cast<>?)
|
|
||
| SQLSMALLINT expected_unsigned_attr = 0; | ||
| SQLSMALLINT expected_auto_unique_value = 0; | ||
| SQLSMALLINT expected_min_scale = 0; | ||
| SQLSMALLINT expected_max_scale = 0; | ||
| SQLSMALLINT expected_sql_datetime_sub = 0; | ||
| SQLSMALLINT expected_num_prec_radix = 0; | ||
| SQLSMALLINT expected_interval_prec = 0; | ||
| CheckSQLGetTypeInfo(stmt, | ||
| std::wstring(L"bit"), // expected_type_name | ||
| SQL_BIT, // expected_data_type | ||
| 1, // expected_column_size | ||
| std::nullopt, // expected_literal_prefix | ||
| std::nullopt, // expected_literal_suffix | ||
| std::nullopt, // expected_create_params | ||
| SQL_NULLABLE, // expected_nullable | ||
| SQL_FALSE, // expected_case_sensitive | ||
| SQL_SEARCHABLE, // expected_searchable | ||
| NULL, // expected_unsigned_attr | ||
| SQL_FALSE, // expected_fixed_prec_scale | ||
| NULL, // expected_auto_unique_value | ||
| std::wstring(L"bit"), // expected_local_type_name | ||
| NULL, // expected_min_scale | ||
| NULL, // expected_max_scale | ||
| SQL_BIT, // expected_sql_data_type | ||
| NULL, // expected_sql_datetime_sub | ||
| NULL, // expected_num_prec_radix | ||
| NULL); // expected_interval_prec | ||
| std::wstring(L"bit"), // expected_type_name |
There was a problem hiding this comment.
Similar comment as columns_test.cc, Let's pass 0 directly to CheckSQLGetTypeInfo. I think passing 0 instead of NULL here will work because NULL is not defined as 0 on Linux
| GetInfoSQLWCHAR(conn, SQL_COLUMN_ALIAS, value); | ||
|
|
||
| EXPECT_STREQ(static_cast<const SQLWCHAR*>(L"Y"), value); | ||
| std::wstring result = ConvertToWString(value, std::wcslen((const wchar_t*)value)); |
There was a problem hiding this comment.
Same comment here for using C++ style casting
87e4526 to
1515f56
Compare
1515f56 to
2512d90
Compare
2512d90 to
ef8318d
Compare
alinaliBQ
left a comment
There was a problem hiding this comment.
LGTM. Fixing the Linux tests can be in a separate PR
Rationale for this change
The test suite needs to be updated so it will build on Linux in addition to Windows & Mac.
What changes are included in this PR?
Miscellaneous changes to get the tests building on Linux.
Are these changes tested?
Yes.
Are there any user-facing changes?
No.