Where does it get errorCount[2]?

Below this test calls getError(0) an getError(1) which the ASSERT_LE(2, errorCount()) should protect. It's ok if there are are more than two errors in the list since we don't deference them, but the EXPECT_EQ(2) will still fail the test.

Also, as I mentioned, getError() does bounds checking, so it currently won't segfault. Checking in the test itself is still good practice.