Merge "ProcessBuilderTest: pids fit into a 32bit int."
diff --git a/luni/src/test/java/libcore/java/lang/LambdaImplementationTest.java b/luni/src/test/java/libcore/java/lang/LambdaImplementationTest.java
index 0161c6a..92ec22f 100644
--- a/luni/src/test/java/libcore/java/lang/LambdaImplementationTest.java
+++ b/luni/src/test/java/libcore/java/lang/LambdaImplementationTest.java
@@ -305,15 +305,16 @@
// Sanity check that the lambdas do the same thing.
assertEquals(r1.call(), r2.call());
- // Unclear if any of this is *guaranteed* to be true.
+ // Two lambdas from different definitions can share the same class or may not so there are
+ // no assertions about the classes for the instances. See JLS 15.27.4.
- // Check the objects are not the same and do not equal. This could influence collection
- // behavior.
- assertNotSame(r1, r2);
- assertTrue(!r1.equals(r2));
-
- // Two lambdas from different definitions can share the same class or may not.
- // See JLS 15.27.4.
+ // We cannot assert anything about the reference equality or equals() behavior of the
+ // instances themselves either.
+ // Implementations are free to return the same object or different if the lambdas are
+ // equivalent. It may affect collections behavior so no code should assume anything about
+ // the identity of the lambda instance.
+ // See the JSR-000335, Part E: Typing and Evaluation. Sharing of stateless instances is not
+ // explicitly called out in the JLS.
}
/**
diff --git a/luni/src/test/java/libcore/libcore/io/OsTest.java b/luni/src/test/java/libcore/libcore/io/OsTest.java
index bc15df0..968b36d 100644
--- a/luni/src/test/java/libcore/libcore/io/OsTest.java
+++ b/luni/src/test/java/libcore/libcore/io/OsTest.java
@@ -942,4 +942,20 @@
}
}
+ public void test_odirect() throws Exception {
+ File testFile = createTempFile("test_odirect", "");
+ try {
+ FileDescriptor fd =
+ Libcore.os.open(testFile.toString(), O_WRONLY | O_DIRECT, S_IRUSR | S_IWUSR);
+ assertNotNull(fd);
+ assertTrue(fd.valid());
+ int flags = Libcore.os.fcntlVoid(fd, F_GETFL);
+ assertTrue("Expected file flags to include " + O_DIRECT + ", actual value: " + flags,
+ 0 != (flags & O_DIRECT));
+ Libcore.os.close(fd);
+ } finally {
+ testFile.delete();
+ }
+ }
+
}