Skip to content

Commit f36d7e9

Browse files
authored
Fix test assertions
1 parent 488e70d commit f36d7e9

13 files changed

+1334
-2372
lines changed

cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_connection_test.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@ TEST(AttributeTests, SetAndGetAttribute) {
3333
const std::optional<Connection::Attribute> first_value =
3434
connection.GetAttribute(Connection::CONNECTION_TIMEOUT);
3535

36-
EXPECT_TRUE(first_value);
37-
38-
EXPECT_EQ(static_cast<uint32_t>(200), std::get<uint32_t>(*first_value));
36+
ASSERT_TRUE(first_value);
37+
ASSERT_EQ(static_cast<uint32_t>(200), std::get<uint32_t>(*first_value));
3938

4039
connection.SetAttribute(Connection::CONNECTION_TIMEOUT, static_cast<uint32_t>(300));
4140

4241
const std::optional<Connection::Attribute> change_value =
4342
connection.GetAttribute(Connection::CONNECTION_TIMEOUT);
4443

45-
EXPECT_TRUE(change_value);
46-
EXPECT_EQ(static_cast<uint32_t>(300), std::get<uint32_t>(*change_value));
44+
ASSERT_TRUE(change_value);
45+
ASSERT_EQ(static_cast<uint32_t>(300), std::get<uint32_t>(*change_value));
4746

4847
connection.Close();
4948
}
@@ -79,8 +78,8 @@ TEST(MetadataSettingsTest, StringColumnLengthTest) {
7978
const std::optional<int32_t> actual_string_column_length =
8079
connection.GetStringColumnLength(properties);
8180

82-
EXPECT_TRUE(actual_string_column_length);
83-
EXPECT_EQ(expected_string_column_length, *actual_string_column_length);
81+
ASSERT_TRUE(actual_string_column_length);
82+
ASSERT_EQ(expected_string_column_length, *actual_string_column_length);
8483

8584
connection.Close();
8685
}

cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_stream_chunk_buffer_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,19 @@ TEST_F(FlightStreamChunkBufferTest, TestMultipleEndpointsInt) {
117117
num_chunks++;
118118

119119
int num_cols = current_chunk.data->num_columns();
120-
EXPECT_EQ(8, num_cols);
120+
ASSERT_EQ(8, num_cols);
121121

122122
for (int i = 0; i < num_cols; i++) {
123123
auto array = current_chunk.data->column(i);
124124
// Each array has random length
125-
EXPECT_GT(array->length(), 0);
125+
ASSERT_GT(array->length(), 0);
126126

127127
VerifyArraysContainIntsOnly(array);
128128
}
129129
}
130130

131131
// Verify 5 batches of data is returned by each of the two endpoints.
132132
// In total 10 batches should be returned.
133-
EXPECT_EQ(10, num_chunks);
133+
ASSERT_EQ(10, num_chunks);
134134
}
135135
} // namespace arrow::flight::sql::odbc

0 commit comments

Comments
 (0)