test/admin_socket: check error message according to OS

Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2015-07-31 17:18:58 +08:00 committed by Kefu Chai
parent f6fa4a28d1
commit b06838a09d

View File

@ -217,7 +217,12 @@ TEST(AdminSocketClient, Ping) {
{
bool ok;
std::string result = client.ping(&ok);
EXPECT_NE(std::string::npos, result.find("Connection refused"));
#if defined(__APPLE__) || defined(__FreeBSD__)
const char* errmsg = "Socket operation on non-socket";
#else
const char* errmsg = "Connection refused";
#endif
EXPECT_NE(std::string::npos, result.find(errmsg));
ASSERT_FALSE(ok);
}
// a daemon is connected to the socket