From d3a7a4c2090ed3198b6eec029b91ae3be9161cdb Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 9 Jul 2014 10:11:10 -0700 Subject: [PATCH] Fix StrError test. --- test/util-test.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/util-test.cc b/test/util-test.cc index 9952f64c..3d76ec2a 100644 --- a/test/util-test.cc +++ b/test/util-test.cc @@ -269,10 +269,16 @@ TEST(UtilTest, StrError) { #else int error_code = EDOM; #endif - int result = StrError(error_code, message = buffer, 1); + + int result = 0; + // StrError never uses buffer on MinGW. +#ifndef __MINGW32__ + result = StrError(error_code, message = buffer, 1); EXPECT_EQ(buffer, message); // Message should point to buffer. EXPECT_EQ(ERANGE, result); EXPECT_STREQ("", message); +#endif + result = StrError(error_code, message = buffer, BUFFER_SIZE); EXPECT_EQ(0, result); std::size_t message_size = std::strlen(message);