Skip to content
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

GH-41201: [C++] Fix mistake in integration test. Explicitly cast std::string to avoid compiler interpreting char* -> bool #41202

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions cpp/src/arrow/flight/integration_tests/test_integration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ class ExpirationTimeRenewFlightEndpointScenario : public Scenario {
/// both "lol_invalid", which will result in errors attempting to set either.
class SessionOptionsServer : public sql::FlightSqlServerBase {
static inline const std::string invalid_option_name = "lol_invalid";
static inline const SessionOptionValue invalid_option_value = "lol_invalid";
static inline const SessionOptionValue invalid_option_value =
std::string("lol_invalid");

const std::string session_middleware_key;
// These will never be threaded so using a plain map and no lock
Expand Down Expand Up @@ -852,7 +853,7 @@ class SessionOptionsScenario : public Scenario {
{{"foolong", 123L},
{"bardouble", 456.0},
{"lol_invalid", "this won't get set"},
{"key_with_invalid_value", "lol_invalid"},
{"key_with_invalid_value", std::string("lol_invalid")},
{"big_ol_string_list", std::vector<std::string>{"a", "b", "sea", "dee", " ",
" ", "geee", "(づ。◕‿‿◕。)づ"}}}};
ARROW_ASSIGN_OR_RAISE(auto res1, client.SetSessionOptions({}, req1));
Expand All @@ -878,16 +879,16 @@ class SessionOptionsScenario : public Scenario {
}
// Update
ARROW_ASSIGN_OR_RAISE(
auto res3,
client.SetSessionOptions(
{}, SetSessionOptionsRequest{
{{"foolong", std::monostate{}},
{"big_ol_string_list", "a,b,sea,dee, , ,geee,(づ。◕‿‿◕。)づ"}}}));
auto res3, client.SetSessionOptions(
{}, SetSessionOptionsRequest{
{{"foolong", std::monostate{}},
{"big_ol_string_list",
std::string("a,b,sea,dee, , ,geee,(づ。◕‿‿◕。)づ")}}}));
ARROW_ASSIGN_OR_RAISE(auto res4, client.GetSessionOptions({}, {}));
if (res4.session_options !=
std::map<std::string, SessionOptionValue>{
{"bardouble", 456.0},
{"big_ol_string_list", "a,b,sea,dee, , ,geee,(づ。◕‿‿◕。)づ"}}) {
{"big_ol_string_list", std::string("a,b,sea,dee, , ,geee,(づ。◕‿‿◕。)づ")}}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably missing the "key_with_invalid_value" in line 856 above?

return Status::Invalid("res4 incorrect: " + res4.ToString());
}

Expand Down
Loading