/aosp12/bionic/tests/ |
H A D | string_test.cpp | 1552 ASSERT_EQ(haystack + 0, memmem(haystack, sizeof(haystack), "", 0)); in TEST() 1554 ASSERT_EQ(haystack + 0, memmem(haystack, sizeof(haystack), "b", 1)); in TEST() 1555 ASSERT_EQ(haystack + 0, memmem(haystack, sizeof(haystack), "bi", 2)); in TEST() 1556 ASSERT_EQ(haystack + 0, memmem(haystack, sizeof(haystack), "big", 3)); in TEST() 1557 ASSERT_EQ(haystack + 0, memmem(haystack, sizeof(haystack), "big\0", 4)); in TEST() 1560 ASSERT_EQ(haystack + 2, memmem(haystack, sizeof(haystack), "g", 1)); in TEST() 1561 ASSERT_EQ(haystack + 10, memmem(haystack, sizeof(haystack), "gi", 2)); in TEST() 1562 ASSERT_EQ(haystack + 10, memmem(haystack, sizeof(haystack), "gia", 3)); in TEST() 1566 ASSERT_EQ(haystack + 25, memmem(haystack, sizeof(haystack), "!", 1)); in TEST() 1567 ASSERT_EQ(haystack + 24, memmem(haystack, sizeof(haystack), "s!", 2)); in TEST() [all …]
|
H A D | wchar_test.cpp | 231 const wchar_t* haystack = L"big daddy/giant haystacks!"; in TEST() local 235 ASSERT_EQ(haystack, wcsstr(haystack, L"")); in TEST() 238 ASSERT_EQ(haystack, wcsstr(haystack, L"b")); in TEST() 239 ASSERT_EQ(haystack, wcsstr(haystack, L"big")); in TEST() 240 ASSERT_EQ(haystack + 9, wcsstr(haystack, L"/")); in TEST() 241 ASSERT_EQ(haystack + 9, wcsstr(haystack, L"/giant")); in TEST() 242 ASSERT_EQ(haystack + 25, wcsstr(haystack, L"!")); in TEST() 243 ASSERT_EQ(haystack + 19, wcsstr(haystack, L"stacks!")); in TEST() 245 ASSERT_EQ(nullptr, wcsstr(haystack, L"monkey")); in TEST()
|
H A D | dlfcn_test.cpp | 58 #define ASSERT_SUBSTR(needle, haystack) \ argument 59 ASSERT_PRED_FORMAT2(::testing::IsSubstring, needle, haystack)
|
H A D | dlext_test.cpp | 57 #define ASSERT_SUBSTR(needle, haystack) \ argument 58 ASSERT_PRED_FORMAT2(::testing::IsSubstring, needle, haystack)
|
/aosp12/frameworks/base/services/tests/wmtests/src/com/android/server/wm/ |
H A D | WindowTracingTest.java | 171 private static boolean containsBytes(byte[] haystack, int haystackLength, byte[] needle) { in containsBytes() argument 177 if (haystack[i + j] != needle[j]) { in containsBytes() 188 byte[] haystack = "hello_world".getBytes(StandardCharsets.UTF_8); in test_containsBytes() 189 assertTrue(containsBytes(haystack, haystack.length, in test_containsBytes() 191 assertTrue(containsBytes(haystack, haystack.length, in test_containsBytes() 193 assertFalse(containsBytes(haystack, 6, in test_containsBytes() 195 assertFalse(containsBytes(haystack, haystack.length, in test_containsBytes() 197 assertFalse(containsBytes(haystack, haystack.length, in test_containsBytes()
|
/aosp12/build/soong/bazel/ |
H A D | properties_test.go | 51 haystack []string 56 haystack: []string{ 70 actualResult := SubtractStrings(tc.haystack, tc.needle) 79 haystack LabelList 84 haystack: LabelList{ 119 actualResult := SubtractBazelLabelList(tc.haystack, tc.needle)
|
H A D | properties.go | 116 func SubtractStrings(haystack []string, needle []string) []string { 120 for _, s := range haystack { 140 func SubtractBazelLabels(haystack []Label, needle []Label) []Label { 144 for _, label := range haystack { 164 func SubtractBazelLabelList(haystack LabelList, needle LabelList) LabelList { 166 result.Includes = SubtractBazelLabels(haystack.Includes, needle.Includes) 168 result.Excludes = haystack.Excludes
|
/aosp12/bionic/linker/ |
H A D | linker_utils.cpp | 121 const char* haystack = file.c_str(); in file_is_in_dir() local 124 return strncmp(haystack, needle, needle_len) == 0 && in file_is_in_dir() 125 haystack[needle_len] == '/' && in file_is_in_dir() 126 strchr(haystack + needle_len + 1, '/') == nullptr; in file_is_in_dir() 131 const char* haystack = file.c_str(); in file_is_under_dir() local 134 return strncmp(haystack, needle, needle_len) == 0 && in file_is_under_dir() 135 haystack[needle_len] == '/'; in file_is_under_dir()
|
/aosp12/system/iorap/src/inode2filename/ |
H A D | main.cc | 125 bool StartsWith(std::string_view haystack, std::string_view needle) { in StartsWith() argument 126 return haystack.size() >= needle.size() in StartsWith() 127 && haystack.compare(0, needle.size(), needle) == 0; in StartsWith() 130 bool EndsWith(std::string_view haystack, std::string_view needle) { in EndsWith() argument 131 return haystack.size() >= needle.size() in EndsWith() 132 && haystack.compare(haystack.size() - needle.size(), haystack.npos, needle) == 0; in EndsWith() 135 bool StartsWithOneOf(std::string_view haystack, in StartsWithOneOf() argument 138 return StartsWith(haystack, needle) || StartsWith(haystack, needle2); in StartsWithOneOf()
|
/aosp12/build/bazel/tests/bionic/ |
H A D | verify_bionic_outputs.sh | 24 local haystack="$2" 25 local message="${3:-Expected regexp "$needle" not found in "$haystack"}" 26 echo "${haystack}" | grep "${needle}" && return 0
|
/aosp12/hardware/interfaces/confirmationui/support/src/ |
H A D | ConfirmationUITranslations.c | 1079 static int ConfirmationUITranslations_find_str(const char** haystack, const char* needle) { in ConfirmationUITranslations_find_str() argument 1080 for (int n = 0; haystack[n] != NULL; n++) { in ConfirmationUITranslations_find_str() 1081 if (strcmp(needle, haystack[n]) == 0) { in ConfirmationUITranslations_find_str()
|
/aosp12/system/teeui/libteeui/prebuilt/localization/ |
H A D | ConfirmationUITranslations.cpp | 1307 static int findStr(const char* const* haystack, const char* needle) { in findStr() argument 1308 for (int n = 0; haystack[n] != nullptr; n++) { in findStr() 1309 if (strcmp(needle, haystack[n]) == 0) { in findStr()
|
/aosp12/art/runtime/ |
H A D | reference_table_test.cc | 262 static std::vector<size_t> FindAll(const std::string& haystack, const char* needle) { in FindAll() argument 266 size_t pos = haystack.find(needle, start); in FindAll() 272 } while (start < haystack.size()); in FindAll() 319 std::string haystack = base.substr(summary_pos); in TEST_F() local 321 std::vector<size_t> strCounts = FindAll(haystack, "java.lang.String"); in TEST_F() 322 std::vector<size_t> b1Counts = FindAll(haystack, "byte[] (1 elements)"); in TEST_F() 323 std::vector<size_t> b2Counts = FindAll(haystack, "byte[] (2 elements)"); in TEST_F() 324 std::vector<size_t> cCounts = FindAll(haystack, "char[]"); in TEST_F()
|
/aosp12/build/make/tools/product_config/src/com/android/build/config/ |
H A D | ConvertMakeToGenericConfig.java | 220 private static ArrayList<String> split(String haystack, String needle) { in split() argument 228 while ((end = haystack.indexOf(needle, start)) >= 0) { in split() 229 result.add(haystack.substring(start, end).trim()); in split() 232 result.add(haystack.substring(start).trim()); in split()
|
/aosp12/frameworks/base/services/core/java/com/android/server/biometrics/ |
H A D | Utils.java | 368 public static boolean listContains(int[] haystack, int needle) { in listContains() argument 369 for (int i = 0; i < haystack.length; i++) { in listContains() 370 if (haystack[i] == needle) { in listContains() 481 private static boolean containsFlag(int haystack, int needle) { in containsFlag() argument 482 return (haystack & needle) != 0; in containsFlag()
|
/aosp12/frameworks/base/core/java/android/hardware/biometrics/ |
H A D | ParentalControlsUtilsInternal.java | 94 private static boolean containsFlag(int haystack, int needle) { in containsFlag() argument 95 return (haystack & needle) != 0; in containsFlag()
|
/aosp12/bionic/benchmarks/ |
H A D | string_benchmark.cpp | 271 std::vector<char> haystack; in BM_string_strstr() local 273 char* haystack_aligned = GetAlignedPtrFilled(&haystack, haystack_alignment, nbytes, 'x'); in BM_string_strstr() 299 std::vector<char> haystack; in BM_string_strchr() local 300 char* haystack_aligned = GetAlignedPtrFilled(&haystack, haystack_alignment, nbytes, 'x'); in BM_string_strchr()
|
/aosp12/frameworks/base/tools/aapt/ |
H A D | Package.cpp | 395 bool endsWith(const char* haystack, const char* needle) in endsWith() argument 397 size_t a = strlen(haystack); in endsWith() 400 return strcasecmp(haystack+(a-b), needle) == 0; in endsWith()
|
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/om/ |
H A D | OverlayManagerSettingsTests.java | 433 private static void assertContains(int[] haystack, int needle) { in assertContains() argument 434 List<Integer> list = IntStream.of(haystack) in assertContains() 443 private static void assertDoesNotContain(int[] haystack, int needle) { in assertDoesNotContain() argument 444 List<Integer> list = IntStream.of(haystack) in assertDoesNotContain()
|
/aosp12/bionic/libc/bionic/ |
H A D | ndk_cruft.cpp | 238 wchar_t* wcswcs(wchar_t* haystack, wchar_t* needle) { in wcswcs() argument 239 return wcsstr(haystack, needle); in wcswcs()
|
/aosp12/bootable/recovery/edify/ |
H A D | expr.cpp | 208 std::string haystack; in SubstringFn() local 209 if (!Evaluate(state, argv[1], &haystack)) { in SubstringFn() 213 std::string result = (haystack.find(needle) != std::string::npos) ? "t" : ""; in SubstringFn()
|
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/ |
H A D | LockSettingsStrongAuthTest.java | 271 private static boolean containsFlag(int haystack, int needle) { in containsFlag() argument 272 return (haystack & needle) != 0; in containsFlag()
|
/aosp12/hardware/broadcom/wlan/bcmdhd/dhdutil/ |
H A D | bcmutils.c | 809 bcmstrstr(const char *haystack, const char *needle) in bcmstrstr() argument 814 if ((haystack == NULL) || (needle == NULL)) in bcmstrstr() 815 return DISCARD_QUAL(haystack, char); in bcmstrstr() 818 len = strlen(haystack) - nlen + 1; in bcmstrstr() 821 if (memcmp(needle, &haystack[i], nlen) == 0) in bcmstrstr() 822 return DISCARD_QUAL(&haystack[i], char); in bcmstrstr()
|
/aosp12/build/make/tools/ |
H A D | compare_builds.py | 632 def RemoveItemsFromList(haystack, needles): argument 635 haystack.remove(needle)
|
/aosp12/hardware/broadcom/wlan/bcmdhd/dhdutil/include/ |
H A D | bcmutils.h | 362 extern char *bcmstrstr(const char *haystack, const char *needle);
|