warning: using untyped List/Map
Bug: 192077108
Test: aidl_unittests
Change-Id: I09d8b3cb3e05fafcb208df7bd7a114e9c6c99615
diff --git a/diagnostics_unittest.cpp b/diagnostics_unittest.cpp
index f616852..8c13df4 100644
--- a/diagnostics_unittest.cpp
+++ b/diagnostics_unittest.cpp
@@ -226,4 +226,25 @@
"import q.IBar;\n" // ugly, but okay
"interface IFoo{}"},
{"q/IBar.aidl", "package q; interface IBar{}"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionInterface) {
+ expect_diagnostics = {DiagnosticID::untyped_collection};
+ ParseFiles({{"IFoo.aidl", "interface IFoo { void foo(in Map m); }"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionParcelable) {
+ expect_diagnostics = {DiagnosticID::untyped_collection};
+ ParseFiles({{"Foo.aidl", "parcelable Foo { Map m; }"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionUnion) {
+ expect_diagnostics = {DiagnosticID::untyped_collection};
+ ParseFiles({{"Foo.aidl", "union Foo { List l; }"}});
+}
+
+TEST_F(DiagnosticsTest, UntypedCollectionInTypeArg) {
+ expect_diagnostics = {DiagnosticID::untyped_collection};
+ ParseFiles({{"IFoo.aidl", "interface IFoo { void foo(in Bar<Map> m); }"},
+ {"Bar.aidl", "parcelable Bar<T> {}"}});
}
\ No newline at end of file