summaryrefslogtreecommitdiff
path: root/test/gtest_output_test_.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/gtest_output_test_.cc')
-rw-r--r--test/gtest_output_test_.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/gtest_output_test_.cc b/test/gtest_output_test_.cc
index 1b08b65..da8b744 100644
--- a/test/gtest_output_test_.cc
+++ b/test/gtest_output_test_.cc
@@ -27,8 +27,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
-// A unit test for Google Test itself. This verifies that the basic
-// constructs of Google Test work.
+// The purpose of this file is to generate Google Test output under
+// various conditions. The output will then be verified by
+// gtest_output_test.py to ensure that Google Test generates the
+// desired messages. Therefore, most tests in this file are MEANT TO
+// FAIL.
//
// Author: wan@google.com (Zhanyong Wan)
@@ -101,6 +104,16 @@ INSTANTIATE_TEST_CASE_P(PrintingFailingParams,
FailingParamTest,
testing::Values(2));
+static const char kGoldenString[] = "\"Line\0 1\"\nLine 2";
+
+TEST(NonfatalFailureTest, EscapesStringOperands) {
+ std::string actual = "actual \"string\"";
+ EXPECT_EQ(kGoldenString, actual);
+
+ const char* golden = kGoldenString;
+ EXPECT_EQ(golden, actual);
+}
+
// Tests catching a fatal failure in a subroutine.
TEST(FatalFailureTest, FatalFailureInSubroutine) {
printf("(expecting a failure that x should be 1)\n");