MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / test_rendering

Function test_rendering

tests/proto.cc:229–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229static 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
272int main(int argc, const char* argv[])
273{

Callers 1

mainFunction · 0.85

Calls 3

errorFunction · 0.85
renderProtoAsConfigFunction · 0.85
cleanupFunction · 0.70

Tested by

no test coverage detected