Address general test code review comments - #125
Conversation
0a486d3 to
4d32a78
Compare
e62cae2 to
89fb490
Compare
89fb490 to
6d02c36
Compare
|
This PR needs to be rebased and it depends on #128 |
adae744 to
778ed61
Compare
| SQLDriverConnect(this->conn, NULL, &connect_str0[0], | ||
| static_cast<SQLSMALLINT>(connect_str0.size()), out_str, | ||
| kOdbcBufferSize, &out_str_len, SQL_DRIVER_NOPROMPT)) | ||
| << GetOdbcErrorMessage(SQL_HANDLE_DBC, conn); |
There was a problem hiding this comment.
How come we are removing << GetOdbcErrorMessage(SQL_HANDLE_DBC, conn);? This is what prints out the error message when things fail.
There was a problem hiding this comment.
Likewise for all the other instances where this is removed.
There was a problem hiding this comment.
Added the checks back. I don't have a strong opinion on this one. Originally I didn't want to flood the terminal with the error messages since they could be the same errors, but GetOdbcErrorMessage will still probably be helpful for debugging, especially when a single test is run.
| // Allocate a connection using alloc handle | ||
| ASSERT_EQ(SQL_SUCCESS, SQLAllocHandle(SQL_HANDLE_DBC, env, &conn)); | ||
|
|
||
| #if defined _WIN32 || defined _WIN64 |
There was a problem hiding this comment.
David explicitly asked me to change this from #if defined _WIN32 || defined _WIN64 to #if defined _WIN32 in a previous PR.
There was a problem hiding this comment.
Thanks for raising this, fixed
| } | ||
|
|
||
| void FlightSQLOdbcHandleRemoteTestBase::SetUp() { | ||
| ODBCRemoteTestBase::SetUp(); |
There was a problem hiding this comment.
You should add the following after SetUp:
if (skipping_test_) {
return;
}
Avoids duplicated code Move test helper functions to anonymous namespace Add `[[nodiscard]]` for ODBC APIs Addresses community comment: https://github.com/apache/arrow/pull/47763/files#r2450014186 Remove `using List=` in test suite definitions Use static_cast for `SQLWCHAR` in type info test Use static_cast for `SQLWCHAR` in tables test * use mutable arrays for places where characters cannot be const Use static_cast for `SQLWCHAR` in columns test Update comment Use static_cast for `SQLWCHAR` in SQLGetInfo test
778ed61 to
b6f8be2
Compare
alinaliBQ
left a comment
There was a problem hiding this comment.
Addressed Justin's comments
| // Allocate a connection using alloc handle | ||
| ASSERT_EQ(SQL_SUCCESS, SQLAllocHandle(SQL_HANDLE_DBC, env, &conn)); | ||
|
|
||
| #if defined _WIN32 || defined _WIN64 |
There was a problem hiding this comment.
Thanks for raising this, fixed
| } | ||
|
|
||
| void FlightSQLOdbcHandleRemoteTestBase::SetUp() { | ||
| ODBCRemoteTestBase::SetUp(); |
| SQLDriverConnect(this->conn, NULL, &connect_str0[0], | ||
| static_cast<SQLSMALLINT>(connect_str0.size()), out_str, | ||
| kOdbcBufferSize, &out_str_len, SQL_DRIVER_NOPROMPT)) | ||
| << GetOdbcErrorMessage(SQL_HANDLE_DBC, conn); |
There was a problem hiding this comment.
Added the checks back. I don't have a strong opinion on this one. Originally I didn't want to flood the terminal with the error messages since they could be the same errors, but GetOdbcErrorMessage will still probably be helpful for debugging, especially when a single test is run.
static_castfor SQLWCHAR character arrays[[nodiscard]]for ODBC APIsusing List=in test suite definitions