MCPcopy Create free account
hub / github.com/apache/arrow / TEST

Function TEST

cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection_test.cc:28–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace arrow::flight::sql::odbc {
27
28TEST(AttributeTests, SetAndGetAttribute) {
29 FlightSqlConnection connection(OdbcVersion::V_3);
30 connection.SetClosed(false);
31
32 connection.SetAttribute(Connection::CONNECTION_TIMEOUT, static_cast<uint32_t>(200));
33 const std::optional<Connection::Attribute> first_value =
34 connection.GetAttribute(Connection::CONNECTION_TIMEOUT);
35
36 EXPECT_TRUE(first_value);
37
38 EXPECT_EQ(static_cast<uint32_t>(200), boost::get<uint32_t>(*first_value));
39
40 connection.SetAttribute(Connection::CONNECTION_TIMEOUT, static_cast<uint32_t>(300));
41
42 const std::optional<Connection::Attribute> change_value =
43 connection.GetAttribute(Connection::CONNECTION_TIMEOUT);
44
45 EXPECT_TRUE(change_value);
46 EXPECT_EQ(static_cast<uint32_t>(300), boost::get<uint32_t>(*change_value));
47
48 connection.Close();
49}
50
51TEST(AttributeTests, GetAttributeWithoutSetting) {
52 FlightSqlConnection connection(OdbcVersion::V_3);

Callers

nothing calls this directly

Calls 12

to_stringFunction · 0.85
LoadFlightSslConfigsFunction · 0.85
SetClosedMethod · 0.80
GetStringColumnLengthMethod · 0.80
GetUseWideCharMethod · 0.80
SetAttributeMethod · 0.45
GetAttributeMethod · 0.45
CloseMethod · 0.45
okMethod · 0.45
ValueMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected