Home
last modified time | relevance | path

Searched refs:str (Results 1 – 25 of 63) sorted by relevance

123

/cts/suite/audio_quality/lib/src/
DStringUtil.cpp24 std::vector<android::String8>* StringUtil::split(const android::String8& str, char delimiter) in split() argument
28 for (unsigned int i = 0; i < str.length(); i++) { in split()
29 if (str[i] == delimiter) { in split()
31 tokens->push_back(substr(str, lastTokenEnd, i - lastTokenEnd)); in split()
36 if (lastTokenEnd < str.length()) { in split()
37 tokens->push_back(substr(str, lastTokenEnd, str.length() - lastTokenEnd)); in split()
42 android::String8 StringUtil::substr(const android::String8& str, size_t pos, size_t n) in substr() argument
44 size_t l = str.length(); in substr()
53 android::String8 result(str.string() + pos, n); in substr()
57 int StringUtil::compare(const android::String8& str, const char* other) in compare() argument
[all …]
DRWBuffer.h81 void writeStr(const android::String8& str) { in writeStr() argument
82 size_t len = str.length(); in writeStr()
84 memcpy(mBuffer + mWrPoint, str.string(), len); in writeStr()
DSimpleScriptExec.cpp41 bool SimpleScriptExec::checkIfPassed(const android::String8& str, const android::String8& reMatch, in checkIfPassed() argument
58 if (regexec(&re, str.string(), nmatch, pmatch, 0) == 0) { in checkIfPassed()
DSimpleScriptExec.h52 static bool checkIfPassed(const android::String8& str, const android::String8& reMatch,
/cts/tests/tests/util/src/android/util/cts/
DStringBuilderPrinterTest.java29 String str = strBuilder.toString(); in testStringBuilderPrinter() local
30 assertTrue(str.startsWith("Hello")); in testStringBuilderPrinter()
31 assertEquals(' ', str.charAt(5)); in testStringBuilderPrinter()
32 assertEquals('A', str.charAt(6)); in testStringBuilderPrinter()
33 assertEquals('n', str.charAt(7)); in testStringBuilderPrinter()
34 assertEquals('d', str.charAt(8)); in testStringBuilderPrinter()
35 assertEquals('r', str.charAt(9)); in testStringBuilderPrinter()
36 assertEquals('o', str.charAt(10)); in testStringBuilderPrinter()
37 assertEquals('i', str.charAt(11)); in testStringBuilderPrinter()
38 assertEquals('d', str.charAt(12)); in testStringBuilderPrinter()
/cts/suite/audio_quality/test/
DStringUtilTest.cpp26 android::String8 str("hello"); in TEST_F() local
27 ASSERT_TRUE(StringUtil::compare(str, "hello") == 0); in TEST_F()
28 ASSERT_TRUE(StringUtil::compare(str, "hi") != 0); in TEST_F()
32 android::String8 str("hello there"); in TEST_F() local
34 android::String8 sub1 = StringUtil::substr(str, 0, 5); in TEST_F()
37 android::String8 sub2 = StringUtil::substr(str, 10, 5); in TEST_F()
40 android::String8 sub3 = StringUtil::substr(str, 6, 5); in TEST_F()
43 android::String8 sub4 = StringUtil::substr(str, 100, 5); in TEST_F()
48 android::String8 str("hello there"); in TEST_F() local
49 ASSERT_TRUE(StringUtil::endsWith(str, "there")); in TEST_F()
[all …]
/cts/tests/tests/text/src/android/text/method/cts/
DMetaKeyKeyListenerTest.java36 final CharSequence str = "123456"; in testPressKey() local
39 final Editable content = Editable.Factory.getInstance().newEditable(str); in testPressKey()
61 final CharSequence str = "123456"; in testReleaseKey() local
64 final Editable content = Editable.Factory.getInstance().newEditable(str); in testReleaseKey()
70 assertEquals(str.charAt(0), content.charAt(0)); in testReleaseKey()
76 assertEquals(str.charAt(1), content.charAt(1)); in testReleaseKey()
82 assertEquals(str.charAt(3), content.charAt(3)); in testReleaseKey()
86 CharSequence str = "123456"; in testAdjustMetaAfterKeypress() local
87 Spannable content = Editable.Factory.getInstance().newEditable(str); in testAdjustMetaAfterKeypress()
89 int len = str.length(); // for one line less than 100 in testAdjustMetaAfterKeypress()
[all …]
DCharacterPickerDialogTest.java49 final CharSequence str = "123456"; in testConstructor() local
50 final Editable content = Editable.Factory.getInstance().newEditable(str); in testConstructor()
69 final CharSequence str = "123456"; in testOnItemClick() local
70 Editable text = Editable.Factory.getInstance().newEditable(str); in testOnItemClick()
78 assertEquals(str, text.toString()); in testOnItemClick()
95 text = Editable.Factory.getInstance().newEditable(str); in testOnItemClick()
99 assertEquals(str, text.toString()); in testOnItemClick()
110 final CharSequence str = "123456"; in testOnClick() local
111 final Editable content = Editable.Factory.getInstance().newEditable(str); in testOnClick()
DTextKeyListenerTest.java48 String str = "hello world! man"; in testShouldCap() local
52 assertFalse(TextKeyListener.shouldCap(Capitalize.NONE, str, 0)); in testShouldCap()
53 assertTrue(TextKeyListener.shouldCap(Capitalize.SENTENCES, str, 0)); in testShouldCap()
54 assertTrue(TextKeyListener.shouldCap(Capitalize.WORDS, str, 0)); in testShouldCap()
55 assertTrue(TextKeyListener.shouldCap(Capitalize.CHARACTERS, str, 0)); in testShouldCap()
57 assertFalse(TextKeyListener.shouldCap(Capitalize.NONE, str, 6)); in testShouldCap()
58 assertFalse(TextKeyListener.shouldCap(Capitalize.SENTENCES, str, 6)); in testShouldCap()
59 assertTrue(TextKeyListener.shouldCap(Capitalize.WORDS, str, 6)); in testShouldCap()
60 assertTrue(TextKeyListener.shouldCap(Capitalize.CHARACTERS, str, 6)); in testShouldCap()
62 assertFalse(TextKeyListener.shouldCap(Capitalize.NONE, str, 13)); in testShouldCap()
[all …]
DNumberKeyListenerTest.java90 SpannableString str = new SpannableString("012345"); in testLookup() local
91 assertEquals('0', mMockNumberKeyListener.lookup(event1, str)); in testLookup()
95 str = new SpannableString("ABCD"); in testLookup()
96 assertEquals('\0', mMockNumberKeyListener.lookup(event2, str)); in testLookup()
99 mMockNumberKeyListener.lookup(null, str); in testLookup()
/cts/tools/dasm/src/dasm/
DUtils.java47 public static Number stringToNumber(String str) in stringToNumber() argument
49 if (str.startsWith("+")) { in stringToNumber()
50 return new Integer(str.substring(1)); in stringToNumber()
52 if (str.startsWith("0x")) { in stringToNumber()
53 return (Utils.stringToSmallestInteger(str.substring(2), 16)); in stringToNumber()
54 } else if (str.indexOf('.') != -1) { in stringToNumber()
56 double x = Double.parseDouble(str); in stringToNumber()
63 return (Utils.stringToSmallestInteger(str, 10)); in stringToNumber()
70 private static Number stringToSmallestInteger(String str, int radix) in stringToSmallestInteger() argument
72 long x = Long.parseLong(str, radix); in stringToSmallestInteger()
DScanner.java280 String str = charBuf.toString(); in next_token() local
286 if ((tok = ReservedWords.get(str)) != null) return tok; in next_token()
289 if (DopInfo.contains(str)) in next_token()
290 return new str_token(sym.Insn, str); in next_token()
292 if (str.charAt(0) == '$') { in next_token()
293 String s = str.substring(1); in next_token()
323 return new str_token(sym.Word, str); in next_token()
458 String str = charBuf.toString(); in readNumber() local
462 if ((tok = ReservedWords.get(str)) != null) return tok; in readNumber()
466 num = Utils.stringToNumber(str); in readNumber()
/cts/suite/audio_quality/lib/include/
DStringUtil.h32 static std::vector<android::String8>* split(const android::String8& str, char delimiter);
34 static android::String8 substr(const android::String8& str, size_t pos, size_t n);
35 static int compare(const android::String8& str, const char* other);
36 static bool endsWith(const android::String8& str, const char* other);
/cts/tests/tests/view/src/android/view/inputmethod/cts/
DBaseInputConnectionTest.java130 CharSequence str = "TestCommit "; in testOpTextMethods() local
131 Editable inputText = Editable.Factory.getInstance().newEditable(str); in testOpTextMethods()
134 int strLength = str.length(); in testOpTextMethods()
136 assertEquals(str.toString(), text2.toString()); in testOpTextMethods()
140 CharSequence expected = str.subSequence(strLength - offLength, strLength); in testOpTextMethods()
144 expected = str.subSequence(0, offLength); in testOpTextMethods()
186 CharSequence str = "TestFinish"; in testFinishComposingText() local
187 Editable inputText = Editable.Factory.getInstance().newEditable(str); in testFinishComposingText()
207 dummyConnection.setComposingText(str, str.length()); in testFinishComposingText()
/cts/tools/vm-tests-tf/src/dot/junit/opcodes/if_nez/
DTest_if_nez.java26 String str = null; in testN2() local
27 assertEquals(1234, t.run(str)); in testN2()
35 String str = "abc"; in testN3() local
36 assertEquals(1, t.run(str)); in testN3()
/cts/tests/tests/calllog/src/android/calllog/cts/
DTestUtils.java44 String str = null; in executeShellCommand() local
46 while ((str = br.readLine()) != null) { in executeShellCommand()
47 out.append(str); in executeShellCommand()
/cts/tests/tests/text/src/android/text/cts/
DAndroidCharacterTest.java148 String str = new String("if(a>b)"); in testMirror() local
149 char[] strChar = str.toCharArray(); in testMirror()
150 assertTrue(AndroidCharacter.mirror(strChar, 0, str.length())); in testMirror()
152 assertFalse(AndroidCharacter.mirror(str.toCharArray(), 0, 2)); in testMirror()
/cts/tests/tests/database/src/android/database/cts/
DAbstractWindowedCursorTest.java60 String str = "abcdefg"; in testIsNull() local
61 assertTrue(mWindow.putString(str, ROW_INDEX0, COLUMN_INDEX0)); in testIsNull()
73 String str = "abcdefg"; in testIsBlob() local
74 assertTrue(mWindow.putString(str, ROW_INDEX0, COLUMN_INDEX0)); in testIsBlob()
98 String str = "abcdefg"; in testGetString() local
99 assertTrue(mWindow.putString(str, ROW_INDEX0, COLUMN_INDEX0)); in testGetString()
100 assertEquals(str, mCursor.getString(COLUMN_INDEX0)); in testGetString()
/cts/tests/tests/os/src/android/os/cts/
DPatternMatcherTest.java79 String str = "test"; in testToString() local
84 mPatternMatcher = new PatternMatcher(str, PatternMatcher.PATTERN_LITERAL); in testToString()
87 mPatternMatcher = new PatternMatcher(str, PatternMatcher.PATTERN_PREFIX); in testToString()
90 mPatternMatcher = new PatternMatcher(str, PatternMatcher.PATTERN_SIMPLE_GLOB); in testToString()
/cts/hostsidetests/appsecurity/src/com/android/cts/appsecurity/
DPermissionsHostTest.java143 private static void assertEmpty(String str) { in assertEmpty() argument
144 if (str == null || str.length() == 0) { in assertEmpty()
147 fail("Expected empty string but found " + str); in assertEmpty()
DAdoptableHostTest.java320 private static void assertSuccess(String str) { in assertSuccess() argument
321 if (str == null || !str.startsWith("Success")) { in assertSuccess()
322 throw new AssertionError("Expected success string but found " + str); in assertSuccess()
326 private static void assertEmpty(String str) { in assertEmpty() argument
327 if (str != null && str.trim().length() > 0) { in assertEmpty()
328 throw new AssertionError("Expected empty string but found " + str); in assertEmpty()
/cts/suite/cts/deviceTests/browserbench/assets/octane/
Dcode-load.js1488 function cacheBust(str, old) { argument
1493 return str.replace(new RegExp(old, "g"), replacement);
/cts/tools/vm-tests-tf/src/dot/junit/opcodes/if_eqz/
DTest_if_eqz.java30 String str = "abc"; in testN2() local
31 assertEquals(1234, t.run(str)); in testN2()
/cts/tests/tests/telecom/src/android/telecom/cts/
DTestUtils.java111 String str = null; in executeShellCommand() local
113 while ((str = br.readLine()) != null) { in executeShellCommand()
114 out.append(str); in executeShellCommand()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/
DAudioFrequencyMicActivity.java332 private void sendMessage(String str) {
335 msg.obj = str;
396 private void sendMessage(String str) {
399 msg.obj = str;
417 String str = (String)msg.obj;
418 if (str != null) {
419 mTest1Result.setText(str);
428 String str = (String)msg.obj;
429 if (str != null) {
430 mTest2Result.setText(str);
[all …]

123