diff options
author | Alice Ryhl <aliceryhl@google.com> | 2024-04-11 12:52:11 +0000 |
---|---|---|
committer | Alice Ryhl <aliceryhl@google.com> | 2024-04-12 12:50:47 +0000 |
commit | 4634c90ba45bda3981241d65714c695f3fb525ff (patch) | |
tree | eadfdae4366f51450dec28fea66fbea7c03fa282 | |
parent | ab2daeca28b23a164a8bb5100e3e39a4092a7689 (diff) | |
download | native-4634c90ba45bda3981241d65714c695f3fb525ff.tar.gz |
binderLibTest: catch binder driver with reversed freezing
This catches the Rust Binder bug that is being fixed by aosp/3037496.
Previously, this test would just get skipped since Rust Binder returned
-EAGAIN on this call. The correct error code for the ioctl being
unsupported is -EINVAL.
Test: Ran test with Rust Binder with and without fix
Test: Ran test with C Binder and it still passes
Change-Id: I6f8b7721e6769053062183710ae81e890fd794bb
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
-rw-r--r-- | libs/binder/tests/binderLibTest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/binder/tests/binderLibTest.cpp b/libs/binder/tests/binderLibTest.cpp index 2cea14f631..1f61f1852a 100644 --- a/libs/binder/tests/binderLibTest.cpp +++ b/libs/binder/tests/binderLibTest.cpp @@ -506,10 +506,11 @@ TEST_F(BinderLibTest, Freeze) { // Pass test on devices where BINDER_FREEZE ioctl is not supported int ret = IPCThreadState::self()->freeze(pid, false, 0); - if (ret != 0) { + if (ret == -EINVAL) { GTEST_SKIP(); return; } + EXPECT_EQ(NO_ERROR, ret); EXPECT_EQ(-EAGAIN, IPCThreadState::self()->freeze(pid, true, 0)); |