From 2cf04119102753e92b5dc09cd3820f5f15d4022f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 11 May 2021 16:27:15 -0700 Subject: Remove String16::remove. This function, ironically, is being removed. Even more amusing, it was never "remove" anyway --- it literally did the opposite, and removed everything *except* the range you passed to it, and should probably have been called "keep"! I'm looking at reimplementing much of libutils, but first I'm improving test coverage, and literally every test I wrote for this failed. And then when I fixed the "obvious bugs" in the implementation, I found there actually were a couple of existing unit tests --- that mostly served to demonstrate just how counter-intuitive this function was. Bug: http://b/156999009 Test: treehugger Change-Id: I41fd85f7c0988070f4039f607d2e57523d862ed9 --- libutils/String16_fuzz.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'libutils/String16_fuzz.cpp') diff --git a/libutils/String16_fuzz.cpp b/libutils/String16_fuzz.cpp index defa0f5a6..d7e5ec783 100644 --- a/libutils/String16_fuzz.cpp +++ b/libutils/String16_fuzz.cpp @@ -72,12 +72,6 @@ std::vector(); str1.replaceAll(findChar, replaceChar); }), - ([](FuzzedDataProvider& dataProvider, android::String16 str1, - android::String16) -> void { - size_t len = dataProvider.ConsumeIntegral(); - size_t begin = dataProvider.ConsumeIntegral(); - str1.remove(len, begin); - }), }; void callFunc(uint8_t index, FuzzedDataProvider& dataProvider, android::String16 str1, @@ -111,7 +105,5 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { callFunc(op, dataProvider, str_one_utf16, str_two_utf16); } - str_one_utf16.remove(0, str_one_utf16.size()); - str_two_utf16.remove(0, str_two_utf16.size()); return 0; } -- cgit v1.2.3