Home
last modified time | relevance | path

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

12345678910>>...30

/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/util/stream/test/org/openjdk/tests/java/util/stream/
DMapOpTest.java60 exerciseOps(countTo(0), s -> s.map(LambdaTestHelpers.identity()), countTo(0)); in testMap()
61 exerciseOps(countTo(1000), s -> s.map(LambdaTestHelpers.identity()), countTo(1000)); in testMap()
65 exerciseOps(countTo(1000), s -> s.map(e -> (Integer) (1000 + e)), range(1001, 2000)); in testMap()
87 … exerciseOpsInt(data, s -> s.map(mId), s -> s.map(e -> e), s -> s.map(e -> e), s -> s.map(e -> e)); in testOps()
88 …exerciseOpsInt(data, s -> s.map(mZero), s -> s.map(e -> 0), s -> s.map(e -> 0), s -> s.map(e -> 0)… in testOps()
89 …exerciseOpsInt(data, s -> s.map(mDoubler), s -> s.map(e -> 2*e), s -> s.map(e -> 2*e), s -> s.map(… in testOps()
90 …exerciseOpsInt(data, s -> s.map(LambdaTestHelpers.compose(mId, mDoubler)), s -> s.map(e -> 2*e), s in testOps()
91 …exerciseOpsInt(data, s -> s.map(LambdaTestHelpers.compose(mDoubler, mDoubler)), s -> s.map(e -> 4*… in testOps()
92 exerciseOps(data, s -> s.mapToInt(i -> i)); in testOps()
93 exerciseOps(data, s -> s.mapToLong(i -> i)); in testOps()
[all …]
DToArrayOpTest.java61 exerciseTerminalOps(data, s -> s.toArray()); in testOps()
69 …Object[] objects = exerciseTerminalOps(data, s -> s.map(i -> (Integer) (i + i)), s -> s.toArray()); in testOpsWithMap()
78 Object[] objects = exerciseTerminalOps(data, s -> s.sorted(), s -> s.toArray()); in testOpsWithSorted()
88s -> s.flatMap(e -> Arrays.stream(new Object[] { e, e })), in testOpsWithFlatMap()
89 s -> s.toArray()); in testOpsWithFlatMap()
98 exerciseTerminalOps(data, s -> s.filter(LambdaTestHelpers.pEven), s -> s.toArray()); in testOpsWithFilter()
104 s -> // First pipeline slice using Object[] with Double elements in testAsArrayWithType()
105 s.sorted() in testAsArrayWithType()
108 s -> s.toArray(Integer[]::new)); in testAsArrayWithType()
113 s -> s.distinct(),
[all …]
DSliceOpTest.java66 exerciseOps(Collections.emptyList(), s -> s.skip(0), Collections.emptyList()); in testSkip()
67 exerciseOps(Collections.emptyList(), s -> s.skip(10), Collections.emptyList()); in testSkip()
69 exerciseOps(countTo(1), s -> s.skip(0), countTo(1)); in testSkip()
70 exerciseOps(countTo(1), s -> s.skip(1), Collections.emptyList()); in testSkip()
71 exerciseOps(countTo(100), s -> s.skip(0), countTo(100)); in testSkip()
72 exerciseOps(countTo(100), s -> s.skip(10), range(11, 100)); in testSkip()
73 exerciseOps(countTo(100), s -> s.skip(100), Collections.emptyList()); in testSkip()
74 exerciseOps(countTo(100), s -> s.skip(200), Collections.emptyList()); in testSkip()
88 exerciseOps(Collections.emptyList(), s -> s.limit(0), Collections.emptyList()); in testLimit()
89 exerciseOps(Collections.emptyList(), s -> s.limit(10), Collections.emptyList()); in testLimit()
[all …]
DIntSliceOpTest.java71 exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(0), EMPTY_INT_ARRAY); in testSkip()
72 exerciseOps(EMPTY_INT_ARRAY, s -> s.skip(10), EMPTY_INT_ARRAY); in testSkip()
74 … exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(0), IntStream.range(1, 2).toArray()); in testSkip()
75 exerciseOps(IntStream.range(1, 2).toArray(), s -> s.skip(1), EMPTY_INT_ARRAY); in testSkip()
76 … exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(0), IntStream.range(1, 101).toArray()); in testSkip()
77 …exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(10), IntStream.range(11, 101).toArray()… in testSkip()
78 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(100), EMPTY_INT_ARRAY); in testSkip()
79 exerciseOps(IntStream.range(1, 101).toArray(), s -> s.skip(200), EMPTY_INT_ARRAY); in testSkip()
93 exerciseOps(EMPTY_INT_ARRAY, s -> s.limit(0), EMPTY_INT_ARRAY); in testLimit()
94 exerciseOps(EMPTY_INT_ARRAY, s -> s.limit(10), EMPTY_INT_ARRAY); in testLimit()
[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 …]
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 …]
DFilterOpTest.java59 exerciseOps(countTo(1000), s -> s.filter(pTrue), countTo(1000)); in testFilter()
60 exerciseOps(countTo(1000), s -> s.filter(pFalse), countTo(0)); in testFilter()
61 exerciseOps(countTo(1000), s -> s.filter(e -> e > 100), range(101, 1000)); in testFilter()
62 exerciseOps(countTo(1000), s -> s.filter(e -> e < 100), countTo(99)); in testFilter()
63 exerciseOps(countTo(1000), s -> s.filter(e -> e == 100), Arrays.asList(100)); in testFilter()
68 Collection<Integer> result = exerciseOps(data, s -> s.filter(pTrue)); in testOps()
71 result = exerciseOps(data, s -> s.filter(pFalse)); in testOps()
74 exerciseOps(data, s -> s.filter(pEven)); in testOps()
75 exerciseOps(data, s -> s.filter(pOdd)); in testOps()
77 result = exerciseOps(data, s -> s.filter(pOdd.and(pEven))); in testOps()
[all …]
DStreamParSeqTest.java37 Stream<Integer> s = Arrays.asList(1, 2, 3, 4).stream().parallel(); in testParSeq() local
38 assertTrue(s.isParallel()); in testParSeq()
40 s = s.sequential(); in testParSeq()
41 assertFalse(s.isParallel()); in testParSeq()
43 s = s.sequential(); in testParSeq()
44 assertFalse(s.isParallel()); in testParSeq()
46 s = s.parallel(); in testParSeq()
47 assertTrue(s.isParallel()); in testParSeq()
49 s = s.parallel(); in testParSeq()
50 assertTrue(s.isParallel()); in testParSeq()
DExplodeOpTest.java67 … exerciseOps(TestData.Factory.ofArray("stringsArray", stringsArray), s -> s.flatMap(flattenChars)); in testFlatMap()
68 …exerciseOps(TestData.Factory.ofArray("LONG_STRING", new String[] {LONG_STRING}), s -> s.flatMap(fl… in testFlatMap()
73 Collection<Integer> result = exerciseOps(data, s -> s.flatMap(mfId)); in testOps()
76 result = exerciseOps(data, s -> s.flatMap(mfNull)); in testOps()
79 result = exerciseOps(data, s-> s.flatMap(e -> Stream.empty())); in testOps()
82 exerciseOps(data, s -> s.flatMap(mfLt)); in testOps()
83 exerciseOps(data, s -> s.flatMap(integerRangeMapper)); in testOps()
84 exerciseOps(data, s -> s.flatMap((Integer e) -> IntStream.range(0, e).boxed().limit(10))); in testOps()
91 …Collection<Integer> result = exerciseOps(data, s -> s.flatMap(i -> Collections.singleton(i).stream… in testIntOps()
95 result = exerciseOps(data, s -> s.flatMap(i -> IntStream.empty())); in testIntOps()
[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/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 …]
DProviderTest.java163 Set s = p.entrySet(); in testEntrySet() local
165 s.clear(); in testEntrySet()
170 assertEquals("Incorrect set size", 8, s.size()); in testEntrySet()
172 for (Iterator it = s.iterator(); it.hasNext();) { in testEntrySet()
242 Set<Object> s = p.keySet(); in testKeySet() local
244 s.clear(); in testKeySet()
249 assertNotSame(s, s1); in testKeySet()
302 Provider.Service s = (Provider.Service)it.next(); in testPutObjectObject() local
303 if ("Type".equals(s.getType()) && in testPutObjectObject()
304 "Algorithm".equals(s.getAlgorithm()) && in testPutObjectObject()
[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/main/java/sun/util/locale/
DLanguageTag.java212 String s = itr.current(); in parse() local
214 if (s.length() == 0) { in parse()
217 sts.errorMsg = "Invalid subtag: " + s; in parse()
235 String s = itr.current(); in parseLanguage() local
236 if (isLanguage(s)) { in parseLanguage()
238 language = s; in parseLanguage()
254 String s = itr.current(); in parseExtlangs() local
255 if (!isExtlang(s)) { in parseExtlangs()
262 extlangs.add(s); in parseExtlangs()
282 String s = itr.current(); in parseScript() local
[all …]
/libcore/ojluni/src/main/native/
Dlinux_close.cpp126 int NET_Read(int s, void* buf, size_t len) { in NET_Read() argument
127 BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); in NET_Read()
130 int NET_ReadV(int s, const struct iovec * vector, int count) { in NET_ReadV() argument
131 BLOCKING_IO_RETURN_INT( s, readv(s, vector, count) ); in NET_ReadV()
134 int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, in NET_RecvFrom() argument
137 BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) ); in NET_RecvFrom()
141 int NET_Send(int s, void *msg, int len, unsigned int flags) { in NET_Send() argument
142 BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); in NET_Send()
145 int NET_WriteV(int s, const struct iovec * vector, int count) { in NET_WriteV() argument
146 BLOCKING_IO_RETURN_INT( s, writev(s, vector, count) ); in NET_WriteV()
[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 …]
/libcore/luni/src/test/java/libcore/java/net/
DConcurrentCloseTest.java50 Socket s = ss.accept(); in test_accept() local
51 fail("accept returned " + s + "!"); in test_accept()
58 Socket s = new Socket(); in test_connect() local
59 new Killer(s).start(); in test_connect()
62 s.connect(UNREACHABLE_ADDRESS); in test_connect()
63 fail("connect returned: " + s + "!"); in test_connect()
70 Socket s = new Socket(); in test_connect_timeout() local
71 new Killer(s).start(); in test_connect_timeout()
74 s.connect(UNREACHABLE_ADDRESS, 3600 * 1000); in test_connect_timeout()
75 fail("connect returned: " + s + "!"); in test_connect_timeout()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DPhaser.java313 private static int unarrivedOf(long s) { in unarrivedOf() argument
314 int counts = (int)s; in unarrivedOf()
318 private static int partiesOf(long s) { in partiesOf() argument
319 return (int)s >>> PARTIES_SHIFT; in partiesOf()
322 private static int phaseOf(long s) { in phaseOf() argument
323 return (int)(s >>> PHASE_SHIFT); in phaseOf()
326 private static int arrivedOf(long s) { in arrivedOf() argument
327 int counts = (int)s; in arrivedOf()
358 private String badArrive(long s) { in badArrive() argument
360 stateToString(s); in badArrive()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DStampedLock.java347 long s, next; // bypass acquireWrite in fully unlocked case only in writeLock() local
348 return ((((s = state) & ABITS) == 0L && in writeLock()
349 U.compareAndSwapLong(this, STATE, s, next = s + WBIT)) ? in writeLock()
360 long s, next; in tryWriteLock() local
361 return ((((s = state) & ABITS) == 0L && in tryWriteLock()
362 U.compareAndSwapLong(this, STATE, s, next = s + WBIT)) ? in tryWriteLock()
421 long s = state, next; // bypass acquireRead on common uncontended case in readLock() local
422 return ((whead == wtail && (s & ABITS) < RFULL && in readLock()
423 U.compareAndSwapLong(this, STATE, s, next = s + RUNIT)) ? in readLock()
435 long s, m, next; in tryReadLock() local
[all …]
/libcore/ojluni/src/main/java/java/util/stream/
DStreamSpliterators.java179 abstract AbstractWrappingSpliterator<P_IN, P_OUT, ?> wrap(Spliterator<P_IN> s);
285 WrappingSpliterator<P_IN, P_OUT> wrap(Spliterator<P_IN> s) {
286 return new WrappingSpliterator<>(ph, s, isParallel);
338 AbstractWrappingSpliterator<P_IN, Integer, ?> wrap(Spliterator<P_IN> s) { in wrap() argument
339 return new IntWrappingSpliterator<>(ph, s, isParallel); in wrap()
396 AbstractWrappingSpliterator<P_IN, Long, ?> wrap(Spliterator<P_IN> s) { in wrap() argument
397 return new LongWrappingSpliterator<>(ph, s, isParallel); in wrap()
454 AbstractWrappingSpliterator<P_IN, Double, ?> wrap(Spliterator<P_IN> s) { in wrap() argument
455 return new DoubleWrappingSpliterator<>(ph, s, isParallel); in wrap()
505 private T_SPLITR s; field in StreamSpliterators.AbstractWrappingSpliterator.DelegatingSpliterator
[all …]

12345678910>>...30