Reject duplicate logger_nodes nodes
If someone tries merging Connections, there is a high likelihood that
they will end up with duplicate nodes in the list. Let's validate that
we end up with no configs with duplicates.
While we are here, do the same validation on the logger_nodes list too.
Change-Id: I05202eff8dcc8b8d09faf4383260b9e2fa8a0933
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/configuration_test.cc b/aos/configuration_test.cc
index 0b842cb..a73a34a 100644
--- a/aos/configuration_test.cc
+++ b/aos/configuration_test.cc
@@ -876,6 +876,27 @@
"Logging timestamps without data");
}
+// Tests that we reject duplicate timestamp destination node configurations.
+TEST_F(ConfigurationDeathTest, DuplicateTimestampDestinationNodes) {
+ EXPECT_DEATH(
+ {
+ FlatbufferDetachedBuffer<Configuration> config = ReadConfig(
+ ArtifactPath("aos/testdata/duplicate_destination_nodes.json"));
+ },
+ "Found duplicate timestamp_logger_nodes in");
+}
+
+// Tests that we reject duplicate logger node configurations for a channel's
+// data.
+TEST_F(ConfigurationDeathTest, DuplicateLoggerNodes) {
+ EXPECT_DEATH(
+ {
+ FlatbufferDetachedBuffer<Configuration> config = ReadConfig(
+ ArtifactPath("aos/testdata/duplicate_logger_nodes.json"));
+ },
+ "Found duplicate logger_nodes in");
+}
+
} // namespace testing
} // namespace configuration
} // namespace aos