libutils: add test for String8

Test crashes with SIGSEGV without the fix in b/23290056, passes otherwise.

Bug: 23290056
Change-Id: I6daca0aa07b5e97b004a9606a0227227fae11896
This commit is contained in:
Sergio Giro 2015-09-07 16:21:12 +01:00
parent ce92d9dba0
commit df5151d30f
1 changed files with 5 additions and 0 deletions

View File

@ -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));
}
}