From df5151d30f12a48ea60e6ca9368bfab72cc3d5b2 Mon Sep 17 00:00:00 2001 From: Sergio Giro Date: Mon, 7 Sep 2015 16:21:12 +0100 Subject: [PATCH] libutils: add test for String8 Test crashes with SIGSEGV without the fix in b/23290056, passes otherwise. Bug: 23290056 Change-Id: I6daca0aa07b5e97b004a9606a0227227fae11896 --- libutils/tests/String8_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libutils/tests/String8_test.cpp b/libutils/tests/String8_test.cpp index c42c68dce..01e64f60a 100644 --- a/libutils/tests/String8_test.cpp +++ b/libutils/tests/String8_test.cpp @@ -72,4 +72,9 @@ TEST_F(String8Test, OperatorPlusEquals) { EXPECT_STREQ(src3, " Verify me."); } +TEST_F(String8Test, SetToSizeMaxReturnsNoMemory) { + const char *in = "some string"; + EXPECT_EQ(NO_MEMORY, String8("").setTo(in, SIZE_MAX)); +} + }