Commit 98bfa181 authored by Stephen Morris's avatar Stephen Morris
Browse files

[3952] Abandon hooks tests on unrecoverable error

Changed some EXPECT_EQ tests to ASSERT_EQ in cases where the length
of a vector was checked and subsequently followed by checks that
accessed elements of the array.  This way, if the array is too short,
the test will cleanly exit rather than possibly segmentation fault.
parent e93368f9
......@@ -884,7 +884,7 @@ TEST_F(ParseConfigTest, oneHooksLibrary) {
bool changed;
hooks_libraries_parser_->getLibraries(libraries, changed);
EXPECT_TRUE(changed);
EXPECT_EQ(1, libraries.size());
ASSERT_EQ(1, libraries.size());
EXPECT_EQ(CALLOUT_LIBRARY_1, libraries[0]);
}
......@@ -904,7 +904,7 @@ TEST_F(ParseConfigTest, twoHooksLibraries) {
bool changed;
hooks_libraries_parser_->getLibraries(libraries, changed);
EXPECT_TRUE(changed);
EXPECT_EQ(2, libraries.size());
ASSERT_EQ(2, libraries.size());
EXPECT_EQ(CALLOUT_LIBRARY_1, libraries[0]);
EXPECT_EQ(CALLOUT_LIBRARY_2, libraries[1]);
}
......@@ -931,7 +931,7 @@ TEST_F(ParseConfigTest, reconfigureSameHooksLibraries) {
bool changed;
hooks_libraries_parser_->getLibraries(libraries, changed);
EXPECT_FALSE(changed);
EXPECT_EQ(2, libraries.size());
ASSERT_EQ(2, libraries.size());
EXPECT_EQ(CALLOUT_LIBRARY_1, libraries[0]);
EXPECT_EQ(CALLOUT_LIBRARY_2, libraries[1]);
}
......@@ -959,7 +959,7 @@ TEST_F(ParseConfigTest, reconfigureReverseHooksLibraries) {
bool changed;
hooks_libraries_parser_->getLibraries(libraries, changed);
EXPECT_TRUE(changed);
EXPECT_EQ(2, libraries.size());
ASSERT_EQ(2, libraries.size());
EXPECT_EQ(CALLOUT_LIBRARY_2, libraries[0]);
EXPECT_EQ(CALLOUT_LIBRARY_1, libraries[1]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment