summaryrefslogtreecommitdiff
path: root/tools/stats_log_api_gen/test_collation.cpp
diff options
context:
space:
mode:
authorTej Singh <singhtejinder@google.com>2020-02-20 18:14:50 -0800
committerMuhammad Qureshi <muhammadq@google.com>2020-03-05 01:06:57 -0800
commitc88fbf1e1c110765f8de1d288a620896c8e96220 (patch)
treee261a2183b5df7f7d178c6d8bde8937e60d0a8a9 /tools/stats_log_api_gen/test_collation.cpp
parent13805decc7ae08011019764acc3830366aa23d49 (diff)
Fail if there are repeated fields in atoms.proto
Repeated fields arent allowed outside of attribution node and key value pairs, so we should fail to build if someone attempts to add one. Bug: 149956370 Test: atest stats-log-api-gen-test Change-Id: I0caa6fcf74dabe8e962360ecccfd3a87fcaa4909 Merged-In: I0caa6fcf74dabe8e962360ecccfd3a87fcaa4909
Diffstat (limited to 'tools/stats_log_api_gen/test_collation.cpp')
-rw-r--r--tools/stats_log_api_gen/test_collation.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/stats_log_api_gen/test_collation.cpp b/tools/stats_log_api_gen/test_collation.cpp
index bcf18ae8bf19..a972e2342cad 100644
--- a/tools/stats_log_api_gen/test_collation.cpp
+++ b/tools/stats_log_api_gen/test_collation.cpp
@@ -98,7 +98,6 @@ TEST(CollationTest, CollateStats) {
EXPECT_SET_CONTAINS_SIGNATURE(
atoms.signatures_to_modules,
JAVA_TYPE_ATTRIBUTION_CHAIN, // AttributionChain
- JAVA_TYPE_DOUBLE, // double
JAVA_TYPE_FLOAT, // float
JAVA_TYPE_LONG, // int64
JAVA_TYPE_LONG, // uint64
@@ -157,13 +156,13 @@ TEST(CollationTest, NonMessageTypeFails) {
}
/**
- * Test that atoms that have non-primitive types are rejected.
+ * Test that atoms that have non-primitive types or repeated fields are rejected.
*/
TEST(CollationTest, FailOnBadTypes) {
Atoms atoms;
int errorCount = collate_atoms(BadTypesEvent::descriptor(), &atoms);
- EXPECT_EQ(2, errorCount);
+ EXPECT_EQ(4, errorCount);
}
/**