Merge "libbinder: can't remark binder stability" am: 87cf89ca6a am: 3e4b252fde
am: 499d257f06
Change-Id: I5509164899f0712fdc3e0bd8d1f3e1e3044f298d
diff --git a/libs/binder/tests/binderStabilityTest.cpp b/libs/binder/tests/binderStabilityTest.cpp
index 490850e..0336b9e 100644
--- a/libs/binder/tests/binderStabilityTest.cpp
+++ b/libs/binder/tests/binderStabilityTest.cpp
@@ -275,6 +275,14 @@
ASSERT_TRUE(MarksStabilityInConstructor::gDestructed);
}
+TEST(BinderStability, RemarkDies) {
+ ASSERT_DEATH({
+ sp<IBinder> binder = new BBinder();
+ Stability::markCompilationUnit(binder.get()); // <-- only called for tests
+ Stability::markVndk(binder.get()); // <-- only called for tests
+ }, "Should only mark known object.");
+}
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);