@@ -169,10 +169,11 @@ TEST(DispatchableTest, MessageWithUnknownProperty) {
169169}
170170
171171TEST (DispatchableTest, DuplicateMapKey) {
172- for (const std::string& json :
173- {" {\" id\" :42,\" id\" :42}" , " {\" params\" :null,\" params\" :null}" ,
174- " {\" method\" :\" foo\" ,\" method\" :\" foo\" }" ,
175- " {\" sessionId\" :\" 42\" ,\" sessionId\" :\" 42\" }" }) {
172+ const std::array<std::string, 4 > jsons = {
173+ {" {\" id\" :42,\" id\" :42}" , " {\" params\" :null,\" params\" :null}" ,
174+ " {\" method\" :\" foo\" ,\" method\" :\" foo\" }" ,
175+ " {\" sessionId\" :\" 42\" ,\" sessionId\" :\" 42\" }" }};
176+ for (const std::string& json : jsons) {
176177 SCOPED_TRACE (" json = " + json);
177178 std::vector<uint8_t > cbor;
178179 ASSERT_TRUE (json::ConvertJSONToCBOR (SpanFrom (json), &cbor).ok ());
@@ -185,11 +186,12 @@ TEST(DispatchableTest, DuplicateMapKey) {
185186}
186187
187188TEST (DispatchableTest, ValidMessageParsesOK_NoParams) {
188- for (const std::string& json :
189- {" {\" id\" :42,\" method\" :\" Foo.executeBar\" ,\" sessionId\" :"
190- " \" f421ssvaz4\" }" ,
191- " {\" id\" :42,\" method\" :\" Foo.executeBar\" ,\" sessionId\" :\" f421ssvaz4\" ,"
192- " \" params\" :null}" }) {
189+ const std::array<std::string, 2 > jsons = {
190+ {" {\" id\" :42,\" method\" :\" Foo.executeBar\" ,\" sessionId\" :"
191+ " \" f421ssvaz4\" }" ,
192+ " {\" id\" :42,\" method\" :\" Foo.executeBar\" ,\" sessionId\" :\" f421ssvaz4\" ,"
193+ " \" params\" :null}" }};
194+ for (const std::string& json : jsons) {
193195 SCOPED_TRACE (" json = " + json);
194196 std::vector<uint8_t > cbor;
195197 ASSERT_TRUE (json::ConvertJSONToCBOR (SpanFrom (json), &cbor).ok ());
0 commit comments