Home
last modified time | relevance | path

Searched refs:string (Results 1 – 25 of 70) sorted by relevance

123

/libcore/ojluni/src/main/java/java/util/
DHexFormat.java520 public byte[] parseHex(CharSequence string) { in parseHex() argument
521 return parseHex(string, 0, string.length()); in parseHex()
542 public byte[] parseHex(CharSequence string, int fromIndex, int toIndex) { in parseHex() argument
543 Objects.requireNonNull(string, "string"); in parseHex()
544 Objects.checkFromToIndex(fromIndex, toIndex, string.length()); in parseHex()
546 if (fromIndex != 0 || toIndex != string.length()) { in parseHex()
547 string = string.subSequence(fromIndex, toIndex); in parseHex()
555 if (string.length() == 0) in parseHex()
559 return parseNoDelimiter(string); in parseHex()
564 if ((string.length() - valueChars) % stride != 0) in parseHex()
[all …]
/libcore/ojluni/src/test/java/lang/String/
DTranslateEscapes.java80 static void verifyEscape(String string, char ch) { in verifyEscape() argument
81 String escapes = "\\" + string; in verifyEscape()
83 String.format("\"%s\" not escape \"%s\"'%n", string, escapes)); in verifyEscape()
86 static void verifyOctalEscape(String string, int octal) { in verifyOctalEscape() argument
87 String escapes = "\\" + string; in verifyOctalEscape()
89 String.format("\"%s\" not octal %o%n", string, octal)); in verifyOctalEscape()
92 static void exceptionThrown(String string) { in exceptionThrown() argument
93 String escapes = "\\" + string; in exceptionThrown()
96 fail(String.format("escape not thrown for %s%n", string)); in exceptionThrown()
102 static void verifyLineTerminator(String string) { in verifyLineTerminator() argument
[all …]
DStringRepeat.java68 for (String string : STRINGS) { in test1()
69 long limit = (long)string.length() * (long)repeat; in test1()
79 verify(String_repeat(string, repeat), string, repeat); in test1() local
159 static String truncate(String string) { in truncate() argument
160 if (string.length() < 80) { in truncate()
161 return string; in truncate()
163 return string.substring(0, 80) + "..."; in truncate()
169 static void verify(String result, String string, int repeat) { in verify() argument
170 if (string.isEmpty() || repeat == 0) { in verify()
172 String message = String.format("\"%s\".repeat(%d)%n", truncate(string), repeat) + in verify()
[all …]
DLines.java75 static void testString(String string) { in testString() argument
76 Stream<String> lines = string.lines(); in testString()
77 Stream<String> brLines = new BufferedReader(new StringReader(string)).lines(); in testString()
89 String replace = string.replaceAll("\n", "\\n").replaceAll("\r", "\\r"); in testString()
95 fail(String.format("Mismatch after line %d of \"%s\"%n", count, string)); in testString()
DTransform.java54 check("multiline", multiline.transform(string -> { in test1()
55 return string.lines() in test1()
/libcore/luni/src/test/native/
Dlibcore_java_lang_ThreadTest.cpp30 const std::string native_thread_name = "foozball"; in TestThreadNaming()
44 return new std::string("Attach failed"); in TestThreadNaming()
47 std::string* exception_message = nullptr; in TestThreadNaming()
54 exception_message = new std::string("expected_thread_name != thread_name: "); in TestThreadNaming()
64 exception_message = new std::string("unexpected thread name : "); in TestThreadNaming()
68 exception_message = new std::string("prctl(PR_GET_NAME) failed :"); in TestThreadNaming()
75 exception_message = new std::string("Detach failed"); in TestThreadNaming()
84 std::string result; in Java_libcore_java_lang_ThreadTest_nativeTestNativeThreadNames()
94 std::string* result_test1; in Java_libcore_java_lang_ThreadTest_nativeTestNativeThreadNames()
113 std::string* result_test2; in Java_libcore_java_lang_ThreadTest_nativeTestNativeThreadNames()
Dlibcore_java_io_FileTest.cpp32 std::string base(baseDirUtf.c_str()); in Java_libcore_java_io_FileTest_nativeTestFilesWithSurrogatePairs()
33 std::string subDir = base + "/dir_\xF0\x93\x80\x80"; in Java_libcore_java_io_FileTest_nativeTestFilesWithSurrogatePairs()
34 std::string subFile = subDir + "/file_\xF0\x93\x80\x80"; in Java_libcore_java_io_FileTest_nativeTestFilesWithSurrogatePairs()
/libcore/ojluni/src/main/java/java/text/
DCharacterIteratorFieldDelegate.java85 AttributedString string = new AttributedString( in formatted() local
88 string.addAttribute(attr, value); in formatted()
89 attributedStrings.add(string); in formatted()
106 public AttributedCharacterIterator getIterator(String string) { in getIterator() argument
109 if (string.length() > size) { in getIterator()
111 string.substring(size))); in getIterator()
112 size = string.length(); in getIterator()
DFormat.java314 String string, AttributedCharacterIterator.Attribute key, in createAttributedCharacterIterator() argument
316 AttributedString as = new AttributedString(string); in createAttributedCharacterIterator()
/libcore/ojluni/src/test/java/nio/file/Path/
DPathOps.java191 PathOps string(String expected) { in string() method in PathOps
218 .string("/"); in doUnixTests()
220 .string("/"); in doUnixTests()
222 .string("/foo"); in doUnixTests()
224 .string("/foo"); in doUnixTests()
226 .string("/foo"); in doUnixTests()
228 .string("foo/bar/gus"); in doUnixTests()
230 .string(""); in doUnixTests()
232 .string("/"); in doUnixTests()
234 .string("foo/bar/gus"); in doUnixTests()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DStringToRealBenchmark.java32 }) String string; field in StringToRealBenchmark
36 Float.parseFloat(string); in timeFloat_parseFloat()
42 Double.parseDouble(string); in timeDouble_parseDouble()
DStringToBytesBenchmark.java58 @Param StringLengths string; field in StringToBytesBenchmark
62 string.value.getBytes(StandardCharsets.UTF_8); in timeGetBytesUtf8()
68 string.value.getBytes(StandardCharsets.ISO_8859_1); in timeGetBytesIso88591()
74 string.value.getBytes(StandardCharsets.US_ASCII); in timeGetBytesAscii()
DCharsetBenchmark.java63 String string = makeString(length); in time_String_getBytes() local
65 string.getBytes(name); in time_String_getBytes()
/libcore/ojluni/src/test/java/text/AttributedString/
DAttributedStringTest.java64 AttributedString string; in main() local
68 string = new AttributedString(text); in main()
69 iterator = string.getIterator(); in main()
78 string.addAttribute(Attribute.LANGUAGE, Locale.ENGLISH, 3, 9); in main()
79 iterator = string.getIterator(); in main()
89 string.addAttribute(Attribute.READING, hi, 0, 5); in main()
90 iterator = string.getIterator(); in main()
112 string.addAttribute(Attribute.LANGUAGE, Locale.US, 0, 5); in main()
113 iterator = string.getIterator(); in main()
127 iterator = string.getIterator(null, 3, 5); in main()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DFloatTest.java67 for (String string : badStrings) { in testSuffixParsing()
69 Float.parseFloat(string); in testSuffixParsing()
70 fail(string); in testSuffixParsing()
90 for (String string : strings) { in testExponentParsing()
92 Float.parseFloat(string); in testExponentParsing()
93 fail(string); in testExponentParsing()
DDoubleTest.java65 for (String string : badStrings) { in testSuffixParsing()
67 Double.parseDouble(string); in testSuffixParsing()
68 fail(string); in testSuffixParsing()
90 for (String string : strings) { in testExponentParsing()
92 Double.parseDouble(string); in testExponentParsing()
93 fail(string); in testExponentParsing()
/libcore/luni/src/main/java/libcore/icu/
DICU.java151 private static void parseLangScriptRegionAndVariants(String string, in parseLangScriptRegionAndVariants() argument
153 final int first = string.indexOf('_'); in parseLangScriptRegionAndVariants()
154 final int second = string.indexOf('_', first + 1); in parseLangScriptRegionAndVariants()
155 final int third = string.indexOf('_', second + 1); in parseLangScriptRegionAndVariants()
158 outputArray[IDX_LANGUAGE] = string; in parseLangScriptRegionAndVariants()
164 outputArray[IDX_LANGUAGE] = string.substring(0, first); in parseLangScriptRegionAndVariants()
165 final String secondString = string.substring(first + 1); in parseLangScriptRegionAndVariants()
185 outputArray[IDX_LANGUAGE] = string.substring(0, first); in parseLangScriptRegionAndVariants()
186 final String secondString = string.substring(first + 1, second); in parseLangScriptRegionAndVariants()
187 final String thirdString = string.substring(second + 1); in parseLangScriptRegionAndVariants()
[all …]
/libcore/luni/src/test/java/libcore/libcore/util/
DHexEncodingTest.java121 private static String lower(String string) { in lower() argument
122 return string.toLowerCase(Locale.ROOT); in lower()
125 private static String upper(String string) { in upper() argument
126 return string.toUpperCase(Locale.ROOT); in upper()
/libcore/tools/upstream/
Dpkg-status54 def colourise(colour, string): argument
56 return "%s%s%s" % (colour, string, RESET)
59 def red(string): argument
61 return colourise(RED, string)
64 def green(string): argument
66 return colourise(GREEN, string)
69 def yellow(string): argument
71 return colourise(YELLOW, string)
82 def colourise(self, string): argument
84 return self.colourfunc(string)
/libcore/ojluni/src/test/java/net/InetSocketAddress/
DToString.java98 public static void testCreateUnresolved(String host, int port, String string) { in testCreateUnresolved() argument
101 if (!string.equals(received)) { in testCreateUnresolved()
102 fail("Expected: " + string + " Received: " + received); in testCreateUnresolved()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DReaderTest.java95 String string = "MY TEST STRING"; in test_read() local
96 char[] srcBuffer = string.toCharArray(); in test_read()
137 String string = "MY TEST STRING"; in test_skip() local
138 char[] srcBuffer = string.toCharArray(); in test_skip()
/libcore/luni/src/main/native/
DExecStrings.cpp39 char* string = const_cast<char*>(env_->GetStringUTFChars(java_string.get(), NULL)); in ExecStrings() local
40 array_[i] = string; in ExecStrings()
DScopedIcuULoc.h25 static void getLocale(const char* localeName, std::string& locale, UErrorCode* status) { in getLocale()
91 std::string mLocale;
/libcore/ojluni/src/main/java/java/time/chrono/
DHijrahChronology.java1032 private int[] parseYMD(String string) { in parseYMD() argument
1034 string = string.trim(); in parseYMD()
1036 if (string.charAt(4) != '-' || string.charAt(7) != '-') { in parseYMD()
1040 ymd[0] = Integer.parseInt(string, 0, 4, 10); in parseYMD()
1041 ymd[1] = Integer.parseInt(string, 5, 7, 10); in parseYMD()
1042 ymd[2] = Integer.parseInt(string, 8, 10, 10); in parseYMD()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/reflect/
DProxyTest.java149 proxy.string(""); in test_newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler()
155 proxy.string("clone"); in test_newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler()
162 proxy.string("error"); in test_newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler()
168 proxy.string("any"); in test_newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler()

123