Home
last modified time | relevance | path

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

12345678910>>...40

/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.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 …]
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 …]
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 …]
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 …]
/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/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/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/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/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 …]
/libcore/ojluni/src/main/native/
Dlinux_close.cpp132 int NET_Read(int s, void* buf, size_t len) { in NET_Read() argument
133 BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); in NET_Read()
136 int NET_ReadV(int s, const struct iovec * vector, int count) { in NET_ReadV() argument
137 BLOCKING_IO_RETURN_INT( s, readv(s, vector, count) ); in NET_ReadV()
140 int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, in NET_RecvFrom() argument
143 BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, &socklen) ); in NET_RecvFrom()
147 int NET_Send(int s, void *msg, int len, unsigned int flags) { in NET_Send() argument
148 BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); in NET_Send()
151 int NET_WriteV(int s, const struct iovec * vector, int count) { in NET_WriteV() argument
152 BLOCKING_IO_RETURN_INT( s, writev(s, vector, count) ); in NET_WriteV()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DStampedLock.java368 final void setStatusRelaxed(int s) { // for off-queue assignment in setStatusRelaxed() argument
369 U.putInt(this, STATUS, s); in setStatusRelaxed()
428 long s, nextState; in tryAcquireWrite() local
429 if (((s = state) & ABITS) == 0L && casState(s, nextState = s | WBIT)) { in tryAcquireWrite()
438 for (long s, m, nextState;;) { in tryAcquireRead()
439 if ((m = (s = state) & ABITS) < RFULL) { in tryAcquireRead()
440 if (casState(s, nextState = s + RUNIT)) in tryAcquireRead()
445 else if ((nextState = tryIncReaderOverflow(s)) != 0L) in tryAcquireRead()
456 private static long unlockWriteState(long s) { in unlockWriteState() argument
457 return ((s += WBIT) == 0L) ? ORIGIN : s; in unlockWriteState()
[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 …]

12345678910>>...40