Home
last modified time | relevance | path

Searched refs:s (Results 1 – 25 of 1085) sorted by relevance

12345678910>>...44

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DScannerTest.java66 private Scanner s; field in ScannerTest
95 s = new Scanner(tmpFile); in test_ConstructorLjava_io_File()
96 assertNotNull(s); in test_ConstructorLjava_io_File()
97 s.close(); in test_ConstructorLjava_io_File()
101 s = new Scanner(tmpFile); in test_ConstructorLjava_io_File()
111 s = new Scanner(tmpFile); in test_ConstructorLjava_io_File()
112 s.close(); in test_ConstructorLjava_io_File()
117 s = new Scanner((File) null); in test_ConstructorLjava_io_File()
135 try (Scanner s = new Scanner(tmpFilePath)){ in test_ConstructorLjava_nio_file_Path() argument
136 assertEquals(testString, s.next()); in test_ConstructorLjava_nio_file_Path()
[all …]
DStackTest.java25 Stack s; field in StackTest
32 assertEquals("Stack creation failed", 0, s.size()); in test_Constructor()
40 assertTrue("New stack answers non-empty", s.empty()); in test_empty()
41 s.push("blah"); in test_empty()
42 assertTrue("Stack should not be empty but answers empty", !s.empty()); in test_empty()
43 s.pop(); in test_empty()
44 assertTrue("Stack should be empty but answers non-empty", s.empty()); in test_empty()
45 s.push(null); in test_empty()
46 assertTrue("Stack with null should not be empty but answers empty", !s in test_empty()
58 s.push(item1); in test_peek()
[all …]
/libcore/ojluni/src/test/java/lang/String/concat/
DImplicitStringConcat.java109 static String s = "foo"; field in ImplicitStringConcat
127 test("footrue", s + b); in testImplicitStringConcat()
128 test("foo42", s + by); in testImplicitStringConcat()
129 test("foo42", s + sh); in testImplicitStringConcat()
130 test("fooa", s + ch); in testImplicitStringConcat()
131 test("foo42", s + i); in testImplicitStringConcat()
132 test("foo42", s + l); in testImplicitStringConcat()
133 test("foo42.0", s + fl); in testImplicitStringConcat()
134 test("foo42.0", s + d); in testImplicitStringConcat()
135 test("foofoo", s + s); in testImplicitStringConcat()
[all …]
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DMapOpTest.java62 exerciseOps(countTo(0), s -> s.map(LambdaTestHelpers.identity()), countTo(0)); in testMap()
63 exerciseOps(countTo(1000), s -> s.map(LambdaTestHelpers.identity()), countTo(1000)); in testMap()
67 exerciseOps(countTo(1000), s -> s.map(e -> (Integer) (1000 + e)), range(1001, 2000)); in testMap()
90 … exerciseOpsInt(data, s -> s.map(mId), s -> s.map(e -> e), s -> s.map(e -> e), s -> s.map(e -> e)); in testOps()
91 …exerciseOpsInt(data, s -> s.map(mZero), s -> s.map(e -> 0), s -> s.map(e -> 0), s -> s.map(e -> 0)… in testOps()
92 …exerciseOpsInt(data, s -> s.map(mDoubler), s -> s.map(e -> 2*e), s -> s.map(e -> 2*e), s -> s.map(… in testOps()
93 …exerciseOpsInt(data, s -> s.map(LambdaTestHelpers.compose(mId, mDoubler)), s -> s.map(e -> 2*e), s in testOps()
94 …exerciseOpsInt(data, s -> s.map(LambdaTestHelpers.compose(mDoubler, mDoubler)), s -> s.map(e -> 4*… in testOps()
95 exerciseOps(data, s -> s.mapToInt(i -> i)); in testOps()
96 exerciseOps(data, s -> s.mapToLong(i -> i)); in testOps()
[all …]
DToArrayOpTest.java63 exerciseTerminalOps(data, s -> s.toArray()); in testOps()
71 …Object[] objects = exerciseTerminalOps(data, s -> s.map(i -> (Integer) (i + i)), s -> s.toArray()); in testOpsWithMap()
80 Object[] objects = exerciseTerminalOps(data, s -> s.sorted(), s -> s.toArray()); in testOpsWithSorted()
90s -> s.flatMap(e -> Arrays.stream(new Object[] { e, e })), in testOpsWithFlatMap()
91 s -> s.toArray()); in testOpsWithFlatMap()
100 exerciseTerminalOps(data, s -> s.filter(LambdaTestHelpers.pEven), s -> s.toArray()); in testOpsWithFilter()
106 s -> // First pipeline slice using Object[] with Double elements in testAsArrayWithType()
107 s.sorted() in testAsArrayWithType()
110 s -> s.toArray(Integer[]::new)); in testAsArrayWithType()
115 s -> s.distinct(),
[all …]
DSliceOpTest.java67 exerciseOps(Collections.emptyList(), s -> s.skip(0), Collections.emptyList()); in testSkip()
68 exerciseOps(Collections.emptyList(), s -> s.skip(10), Collections.emptyList()); in testSkip()
70 exerciseOps(countTo(1), s -> s.skip(0), countTo(1)); in testSkip()
71 exerciseOps(countTo(1), s -> s.skip(1), Collections.emptyList()); in testSkip()
72 exerciseOps(countTo(100), s -> s.skip(0), countTo(100)); in testSkip()
73 exerciseOps(countTo(100), s -> s.skip(10), range(11, 100)); in testSkip()
74 exerciseOps(countTo(100), s -> s.skip(100), Collections.emptyList()); in testSkip()
75 exerciseOps(countTo(100), s -> s.skip(200), Collections.emptyList()); in testSkip()
89 exerciseOps(Collections.emptyList(), s -> s.limit(0), Collections.emptyList()); in testLimit()
90 exerciseOps(Collections.emptyList(), s -> s.limit(10), Collections.emptyList()); in testLimit()
[all …]
DFilterOpTest.java55 exerciseOps(countTo(1000), s -> s.filter(pTrue), countTo(1000)); in testFilter()
56 exerciseOps(countTo(1000), s -> s.filter(pFalse), countTo(0)); in testFilter()
57 exerciseOps(countTo(1000), s -> s.filter(e -> e > 100), range(101, 1000)); in testFilter()
58 exerciseOps(countTo(1000), s -> s.filter(e -> e < 100), countTo(99)); in testFilter()
59 exerciseOps(countTo(1000), s -> s.filter(e -> e == 100), Arrays.asList(100)); in testFilter()
64 Collection<Integer> result = exerciseOps(data, s -> s.filter(pTrue)); in testOps()
67 result = exerciseOps(data, s -> s.filter(pFalse)); in testOps()
70 exerciseOps(data, s -> s.filter(pEven)); in testOps()
71 exerciseOps(data, s -> s.filter(pOdd)); in testOps()
73 result = exerciseOps(data, s -> s.filter(pOdd.and(pEven))); in testOps()
[all …]
DReduceTest.java62 …assertEquals(0, (int) exerciseTerminalOps(data, s -> s.filter(pFalse), s -> s.reduce(0, rPlus, rPl… in testOps()
64 Optional<Integer> seedless = exerciseTerminalOps(data, s -> s.reduce(rPlus)); in testOps()
65 Integer folded = exerciseTerminalOps(data, s -> s.reduce(0, rPlus, rPlus)); in testOps()
68 seedless = exerciseTerminalOps(data, s -> s.reduce(rMin)); in testOps()
69 folded = exerciseTerminalOps(data, s -> s.reduce(Integer.MAX_VALUE, rMin, rMin)); in testOps()
72 seedless = exerciseTerminalOps(data, s -> s.reduce(rMax)); in testOps()
73 folded = exerciseTerminalOps(data, s -> s.reduce(Integer.MIN_VALUE, rMax, rMax)); in testOps()
76 seedless = exerciseTerminalOps(data, s -> s.map(mDoubler), s -> s.reduce(rPlus)); in testOps()
77 folded = exerciseTerminalOps(data, s -> s.map(mDoubler), s -> s.reduce(0, rPlus, rPlus)); in testOps()
80 seedless = exerciseTerminalOps(data, s -> s.map(mDoubler), s -> s.reduce(rMin)); in testOps()
[all …]
DIntReduceTest.java56 …assertEquals(0, (int) exerciseTerminalOps(data, s -> s.filter(ipFalse), s -> s.reduce(0, irPlus))); in testOps()
58 OptionalInt seedless = exerciseTerminalOps(data, s -> s.reduce(irPlus)); in testOps()
59 int folded = exerciseTerminalOps(data, s -> s.reduce(0, irPlus)); in testOps()
62 seedless = exerciseTerminalOps(data, s -> s.reduce(irMin)); in testOps()
63 folded = exerciseTerminalOps(data, s -> s.reduce(Integer.MAX_VALUE, irMin)); in testOps()
66 seedless = exerciseTerminalOps(data, s -> s.reduce(irMax)); in testOps()
67 folded = exerciseTerminalOps(data, s -> s.reduce(Integer.MIN_VALUE, irMax)); in testOps()
70 seedless = exerciseTerminalOps(data, s -> s.map(irDoubler), s -> s.reduce(irPlus)); in testOps()
71 folded = exerciseTerminalOps(data, s -> s.map(irDoubler), s -> s.reduce(0, irPlus)); in testOps()
74 seedless = exerciseTerminalOps(data, s -> s.map(irDoubler), s -> s.reduce(irMin)); in testOps()
[all …]
DIntSliceOpTest.java73 exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(0), EMPTY_INT_ARRAY); in testSkip()
74 exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(10), EMPTY_INT_ARRAY); in testSkip()
76 … exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(0), IntStream.range(1, 2).toArray()); in testSkip()
77 exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(1), EMPTY_INT_ARRAY); in testSkip()
78 … exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0), IntStream.range(1, 101).toArray()); in testSkip()
79 …exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10), IntStream.range(11, 101).toArray()… in testSkip()
80 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100), EMPTY_INT_ARRAY); in testSkip()
81 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200), EMPTY_INT_ARRAY); in testSkip()
95 exerciseOps(EMPTY_INT_ARRAY, s -> s.limit(0), EMPTY_INT_ARRAY); in testLimit()
96 exerciseOps(EMPTY_INT_ARRAY, s -> s.limit(10), EMPTY_INT_ARRAY); in testLimit()
[all …]
DFindFirstOpTest.java51 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(pEven).findFirst().get()}).st… in testFindFirst()
52 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.findFirst().get()}).stream(), Arrays… in testFindFirst()
53 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(e -> e == 499).findFirst().ge… in testFindFirst()
54 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(e -> e == 999).findFirst().ge… in testFindFirst()
55 …exerciseOps(countTo(0), s -> Arrays.asList(new Integer[]{s.findFirst().orElse(-1)}).stream(), Arra… in testFindFirst()
56 …exerciseOps(countTo(1000), s -> Arrays.asList(new Integer[]{s.filter(e -> e == 1499).findFirst().o… in testFindFirst()
61 exerciseStream(data, s -> s); in testStream()
62 exerciseStream(data, s -> s.filter(pTrue)); in testStream()
63 exerciseStream(data, s -> s.filter(pFalse)); in testStream()
64 exerciseStream(data, s -> s.filter(pEven)); in testStream()
[all …]
DMapMultiOpTest.java91 public void testNullMapper(Stream<Integer> s) { in testNullMapper() argument
92 checkNPE(() -> s.mapMulti(null)); in testNullMapper()
93 checkNPE(() -> s.mapMultiToInt(null)); in testNullMapper()
94 checkNPE(() -> s.mapMultiToDouble(null)); in testNullMapper()
95 checkNPE(() -> s.mapMultiToLong(null)); in testNullMapper()
113 stringsArray), s -> s.mapMulti(charConsumer)); in testMapMulti()
115 new String[]{LONG_STRING}), s -> s.mapMulti(charConsumer)); in testMapMulti()
133 stringsArray), s -> delegateTo(s).mapMulti(charConsumer)); in testDefaultMapMulti()
135 new String[]{LONG_STRING}), s -> delegateTo(s).mapMulti(charConsumer)); in testDefaultMapMulti()
141 testOps(name, data, s -> s); in testOps()
[all …]
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DDefaultMethodStreams.java93 Class<?> s = Stream.of(del.getInterfaces()) in verify() local
98 Set<String> dms = Stream.of(s.getMethods()) in verify()
113 throw new AssertionError(String.format("%s overrides default methods of %s\n", del, s)); in verify()
127 public static <T> Stream<T> delegateTo(Stream<T> s) { in delegateTo() argument
128 return new DefaultMethodRefStream<>(s); in delegateTo()
140 public static IntStream delegateTo(IntStream s) { in delegateTo() argument
141 return new DefaultMethodIntStream(s); in delegateTo()
153 public static LongStream delegateTo(LongStream s) { in delegateTo() argument
154 return new DefaultMethodLongStream(s); in delegateTo()
166 public static DoubleStream delegateTo(DoubleStream s) { in delegateTo() argument
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DSemaphoreTest.java77 InterruptibleLockRunnable(Semaphore s) { lock = s; } in InterruptibleLockRunnable() argument
91 InterruptedLockRunnable(Semaphore s) { lock = s; } in InterruptedLockRunnable() argument
100 void waitForQueuedThread(PublicSemaphore s, Thread t) { in waitForQueuedThread() argument
102 while (!s.hasQueuedThread(t)) { in waitForQueuedThread()
107 assertTrue(s.hasQueuedThreads()); in waitForQueuedThread()
114 void waitForQueuedThreads(Semaphore s) { in waitForQueuedThreads() argument
116 while (!s.hasQueuedThreads()) { in waitForQueuedThreads()
125 void acquire(Semaphore s) throws InterruptedException { in acquire() argument
126 s.acquire(); in acquire()
130 void acquire(Semaphore s, int permits) throws InterruptedException { in acquireN() argument
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DSemaphoreTest.java54 InterruptibleLockRunnable(Semaphore s) { lock = s; } in InterruptibleLockRunnable() argument
68 InterruptedLockRunnable(Semaphore s) { lock = s; } in InterruptedLockRunnable() argument
77 void waitForQueuedThread(PublicSemaphore s, Thread t) { in waitForQueuedThread() argument
79 while (!s.hasQueuedThread(t)) { in waitForQueuedThread()
84 assertTrue(s.hasQueuedThreads()); in waitForQueuedThread()
91 void waitForQueuedThreads(Semaphore s) { in waitForQueuedThreads() argument
93 while (!s.hasQueuedThreads()) { in waitForQueuedThreads()
102 void acquire(Semaphore s) throws InterruptedException { in acquire() argument
103 s.acquire(); in acquire()
107 void acquire(Semaphore s, int permits) throws InterruptedException { in acquireN() argument
[all …]
DStampedLockTest.java56 void releaseWriteLock(StampedLock lock, long s) { in releaseWriteLock() argument
58 lock.unlockWrite(s); in releaseWriteLock()
81 long s = lock.writeLock(); in testLock() local
85 lock.unlockWrite(s); in testLock()
107 long s = lock.writeLock(); in testUnlock() local
111 lock.unlock(s); in testUnlock()
134 long s = lock.writeLock(); in testTryUnlock() local
174 long s = lock.writeLock(); in testWriteUnlock_IMSE2() local
175 lock.unlockWrite(s); in testWriteUnlock_IMSE2()
177 lock.unlockWrite(s); in testWriteUnlock_IMSE2()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DStringTest.java95 String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0); in test_Constructor$BI() local
96 assertEquals("Incorrect string returned: " + s, "ABCDE", s); in test_Constructor$BI()
97 s = new String(new byte[] { 65, 66, 67, 68, 69 }, 1); in test_Constructor$BI()
98 assertFalse("Did not use nonzero hibyte", s.equals("ABCDE")); in test_Constructor$BI()
115 String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0, 1, 3); in test_Constructor$BIII() local
116 assertEquals("Incorrect string returned: " + s, "BCD", s); in test_Constructor$BIII()
117 s = new String(new byte[] { 65, 66, 67, 68, 69 }, 1, 0, 5); in test_Constructor$BIII()
118 assertFalse("Did not use nonzero hibyte", s.equals("ABCDE")); in test_Constructor$BIII()
122 String s = new String(new byte[] { 65, 66, 67, 68, 69 }, 0, 5, "8859_1"); in test_Constructor$BIILjava_lang_String() local
123 assertEquals("Incorrect string returned: " + s, "ABCDE", s); in test_Constructor$BIILjava_lang_String()
[all …]
/libcore/ojluni/src/test/java/util/Collections/
DMinMax.java40 Set s = new LyingSet(); in main() local
41 s.add("x"); in main()
42 if (!Collections.min(s).equals("x")) in main()
43 throw new RuntimeException("1: " + Collections.min(s)); in main()
44 if (!Collections.max(s).equals("x")) in main()
45 throw new RuntimeException("2: " + Collections.max(s)); in main()
47 s.add("y"); in main()
48 if (!Collections.min(s).equals("x")) in main()
49 throw new RuntimeException("3: " + Collections.min(s)); in main()
50 if (!Collections.max(s).equals("y")) in main()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DSignatureTest.java61 MySignature1 s = new MySignature1(algorithms[i]); in testConstructor() local
62 assertEquals(algorithms[i],s.getAlgorithm()); in testConstructor()
63 assertNull(s.getProvider()); in testConstructor()
64 assertEquals(0, s.getState()); in testConstructor()
82 MySignature1 s = new MySignature1("ABC"); in testClone() local
84 s.clone(); in testClone()
99 MySignature1 s = new MySignature1("ABC"); in testGetProvider() local
101 assertEquals("state", MySignature1.UNINITIALIZED, s.getState()); in testGetProvider()
102 assertNull("provider", s.getProvider()); in testGetProvider()
106 MySignature1 s = new MySignature1("ABC"); in testGetAlgorithm() local
[all …]
/libcore/ojluni/src/test/java/util/BitSet/
DPreviousBits.java37 void testHashCode(final BitSet s) { in testHashCode() argument
39 long[] words = s.toLongArray(); in testHashCode()
42 equal((int)((h >> 32) ^ h), s.hashCode()); in testHashCode()
45 void testOutOfBounds(final BitSet s) { in testOutOfBounds() argument
47 new F(){void f(){ s.previousSetBit(-2);}}, in testOutOfBounds()
48 new F(){void f(){ s.previousClearBit(-2);}}, in testOutOfBounds()
49 new F(){void f(){ s.previousSetBit(Integer.MIN_VALUE);}}, in testOutOfBounds()
50 new F(){void f(){ s.previousClearBit(Integer.MIN_VALUE);}}, in testOutOfBounds()
51 new F(){void f(){ s.nextSetBit(-1);}}, in testOutOfBounds()
52 new F(){void f(){ s.nextClearBit(-1);}}, in testOutOfBounds()
[all …]
DStickySize.java37 static void equalClones(BitSet s, int expectedSize) { in equalClones() argument
38 equal(expectedSize, clone(s).size()); in equalClones()
39 equal(expectedSize, serialClone(s).size()); in equalClones()
40 equal(expectedSize, s.size()); in equalClones()
41 equal(clone(s), serialClone(s)); in equalClones()
45 BitSet s; in realMain() local
47 s = new BitSet(); // non-sticky in realMain()
48 equal(s.size(), 64); in realMain()
49 equalClones(s, 0); in realMain()
50 s.set(3*64); in realMain()
[all …]
/libcore/luni/src/test/java/libcore/java/math/
DOldBigIntegerToStringTest.java31 String s = "0000000000"; in test_toString1() local
32 BigInteger bi = new BigInteger(s); in test_toString1()
34 assertEquals("toString method returns incorrect value instead of " + s, sBI, "0"); in test_toString1()
38 String s = "1234567890987654321"; in test_toString2() local
39 BigInteger bi = new BigInteger(s); in test_toString2()
41 assertEquals("toString method returns incorrect value instead of " + s, sBI, s); in test_toString2()
45 String s = "-1234567890987654321"; in test_toString3() local
46 BigInteger bi = new BigInteger(s); in test_toString3()
48 assertEquals("toString method returns incorrect value instead of " + s, sBI, s); in test_toString3()
52 String s = "12345678901234"; in test_toString4() local
[all …]
/libcore/ojluni/src/test/java/util/Scanner/
DScanTest.java924 Scanner s = new Scanner("1 fish 2 fish red fish blue fish"); in example1() local
925 s.useDelimiter("\\s*fish\\s*"); in example1()
927 while (s.hasNext()) in example1()
928 results.add(s.next()); in example1()
933 Scanner s = new Scanner("1 fish 2 fish red fish blue fish"); in example2() local
934 s.useDelimiter("\\s*fish\\s*"); in example2()
935 System.out.println(s.nextInt()); in example2()
936 System.out.println(s.nextInt()); in example2()
937 System.out.println(s.next()); in example2()
938 System.out.println(s.next()); in example2()
[all …]
/libcore/ojluni/src/main/java/sun/util/locale/
DLanguageTag.java213 String s = itr.current(); in parse() local
215 if (s.isEmpty()) { in parse()
218 sts.errorMsg = "Invalid subtag: " + s; in parse()
236 String s = itr.current(); in parseLanguage() local
237 if (isLanguage(s)) { in parseLanguage()
239 language = s; in parseLanguage()
255 String s = itr.current(); in parseExtlangs() local
256 if (!isExtlang(s)) { in parseExtlangs()
263 extlangs.add(s); in parseExtlangs()
283 String s = itr.current(); in parseScript() local
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DPrintWriterTest.java71 String s; in test_ConstructorLjava_io_OutputStream() local
77 s = br.readLine(); in test_ConstructorLjava_io_OutputStream()
78 assertTrue("Incorrect string written/read: " + s, s in test_ConstructorLjava_io_OutputStream()
80 s = br.readLine(); in test_ConstructorLjava_io_OutputStream()
81 assertTrue("Incorrect string written/read: " + s, s in test_ConstructorLjava_io_OutputStream()
93 String s; in test_ConstructorLjava_io_OutputStreamZ() local
99 s = br.readLine(); in test_ConstructorLjava_io_OutputStreamZ()
100 assertTrue("Incorrect string written/read: " + s, s in test_ConstructorLjava_io_OutputStreamZ()
104 s = br.readLine(); in test_ConstructorLjava_io_OutputStreamZ()
105 assertTrue("Incorrect string written/read: " + s, s in test_ConstructorLjava_io_OutputStreamZ()
[all …]

12345678910>>...44