Fix the linking of various tests against GMock
[folly.git] / folly / test / SafeAssertTest.cpp
index db075411a847b5c1cb87ec205f0cf2a19c3dad78..8df2b8cac46c609fa9fefd3f94e8314465a87a0d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <folly/SafeAssert.h>
 
 #include <glog/logging.h>
-#include <gtest/gtest.h>
 
 #include <folly/Benchmark.h>
+#include <folly/portability/GTest.h>
 
 using namespace folly;
 
-void fail() {
-  FOLLY_SAFE_CHECK(0, "hello");
+[[noreturn]] void fail() {
+  FOLLY_SAFE_CHECK(0 + 0, "hello");
 }
 
 void succeed() {
@@ -33,6 +33,6 @@ void succeed() {
 
 TEST(SafeAssert, AssertionFailure) {
   succeed();
-  EXPECT_DEATH(fail(), ".*Assertion failure:.*hello.*");
+  EXPECT_DEATH(fail(), "Assertion failure: 0 \\+ 0");
+  EXPECT_DEATH(fail(), "Message: hello");
 }
-