| 26 | namespace arrow::flight::sql::odbc { |
| 27 | |
| 28 | TEST(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 | |
| 51 | TEST(AttributeTests, GetAttributeWithoutSetting) { |
| 52 | FlightSqlConnection connection(OdbcVersion::V_3); |
nothing calls this directly
no test coverage detected