justing-bq commented on code in PR #49786:
URL: https://github.com/apache/arrow/pull/49786#discussion_r3300133913
##########
cpp/src/arrow/flight/sql/odbc/tests/connection_attr_test.cc:
##########
@@ -117,31 +124,33 @@ TYPED_TEST(ConnectionAttributeTest,
TestSQLSetConnectAttrTraceDMOnly) {
}
#endif // __APPLE__
-TYPED_TEST(ConnectionAttributeTest, TestSQLSetConnectAttrTracefileDMOnly) {
+TYPED_TEST(ConnectionAttributePreConnectTest,
TestSQLSetConnectAttrTracefileDMOnly) {
// Verify DM-only attribute is handled by Driver Manager
- // Use placeholder value as we want the call to fail, or else
- // the driver manager will produce a trace file.
+ // Use placeholder value to avoid the driver manager from producing a trace
file.
std::wstring trace_file = L"invalid/file/path";
std::vector<SQLWCHAR> trace_file0(trace_file.begin(), trace_file.end());
+
+#ifdef _WIN32
ASSERT_EQ(SQL_ERROR, SQLSetConnectAttr(this->conn, SQL_ATTR_TRACEFILE,
&trace_file0[0],
static_cast<SQLINTEGER>(trace_file0.size())));
-#ifdef __APPLE__
- VerifyOdbcErrorState(SQL_HANDLE_DBC, this->conn, kErrorStateHYC00);
-#else
VerifyOdbcErrorState(SQL_HANDLE_DBC, this->conn, kErrorStateHY000);
-#endif // __APPLE__
+#else // Mac & Linux
+ ASSERT_EQ(SQL_SUCCESS,
+ SQLSetConnectAttr(this->conn, SQL_ATTR_TRACEFILE, &trace_file0[0],
+ static_cast<SQLINTEGER>(trace_file0.size())));
Review Comment:
Now using `ASSIGN_SQLWCHAR_ARR_AND_LEN`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]