warnings: mixed-oneway can be suppressed at method level.
mixed-oneway is checked at interface level, so method level suppression
didn't work. But now, we skip methods annotated
@SuppressWarnings(mixed-oneway) when checking.
interface IFoo {
void foo();
@SuppressWarnings(value={"mixed-oneway"})
oneway void bar();
}
Bug: n/a
Test: aidl_unittests
Change-Id: Ife0d1c2e53f7cdfbd60d96865e0a4ad4f105c8a8
diff --git a/diagnostics_unittest.cpp b/diagnostics_unittest.cpp
index eed824c..f616852 100644
--- a/diagnostics_unittest.cpp
+++ b/diagnostics_unittest.cpp
@@ -129,6 +129,17 @@
});
}
+TEST_F(DiagnosticsTest, DontMixOnewayWithTwowayMethodsSuppressedAtMethod) {
+ expect_diagnostics = {};
+ ParseFiles({
+ {"IFoo.aidl",
+ "interface IFoo {\n"
+ " void foo();\n"
+ " @SuppressWarnings(value={\"mixed-oneway\"}) oneway void bar();\n"
+ "}"},
+ });
+}
+
TEST_F(DiagnosticsTest, OnewayInterfaceIsOkayWithSyntheticMethods) {
optional_args = "--version 2"; // will add getInterfaceVersion() synthetic method
expect_diagnostics = {};