Fix test.

This commit is contained in:
Victor Zverovich 2014-04-30 13:28:05 -07:00
parent d3b1783647
commit d35411817e

View File

@ -251,9 +251,11 @@ TEST(UtilTest, UTF8ToUTF16) {
TEST(UtilTest, StrError) {
using fmt::internal::StrError;
char *message = 0;
EXPECT_DEBUG_DEATH(StrError(EDOM, message = 0, 0), "Assertion");
char buffer[BUFFER_SIZE];
#ifndef NDEBUG
EXPECT_DEBUG_DEATH(StrError(EDOM, message = 0, 0), "Assertion");
EXPECT_DEBUG_DEATH(StrError(EDOM, message = buffer, 0), "Assertion");
#endif
buffer[0] = 'x';
#ifdef _GNU_SOURCE
// Use invalid error code to make sure that StrError returns an error