| 227 | } |
| 228 | |
| 229 | static void test_rendering(void) |
| 230 | { |
| 231 | std::string s = R"M( |
| 232 | i64: -1 |
| 233 | i32: -2 |
| 234 | u64: 3 |
| 235 | u32: 4 |
| 236 | d: 5.5 |
| 237 | f: 6.7 |
| 238 | m { |
| 239 | s: "string" |
| 240 | } |
| 241 | r { |
| 242 | s: "val2" |
| 243 | } |
| 244 | r { |
| 245 | s: "val3" |
| 246 | } |
| 247 | secondoption { |
| 248 | s: "2" |
| 249 | } |
| 250 | )M"; |
| 251 | |
| 252 | TestProto proto; |
| 253 | if (!google::protobuf::TextFormat::MergeFromString(cleanup(s), &proto)) |
| 254 | error("couldn't load test proto"); |
| 255 | |
| 256 | auto config = renderProtoAsConfig(&proto); |
| 257 | |
| 258 | AssertThat(cleanup(config), Equals(cleanup(R"M( |
| 259 | i64=-1 |
| 260 | i32=-2 |
| 261 | u64=3 |
| 262 | u32=4 |
| 263 | d=5.5 |
| 264 | m.s=string |
| 265 | r[0].s=val2 |
| 266 | r[1].s=val3 |
| 267 | secondoption.s=2 |
| 268 | f=6.7 |
| 269 | )M"))); |
| 270 | } |
| 271 | |
| 272 | int main(int argc, const char* argv[]) |
| 273 | { |
no test coverage detected