File: testcase.cpp

package info (click to toggle)
protozero 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,548 kB
  • sloc: cpp: 20,364; sh: 18; makefile: 14
file content (31 lines) | stat: -rw-r--r-- 555 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include <testcase.hpp>

#include "testcase.pb.h"

int main() {
    TestComplex::Test msg;

    msg.set_f(12345678);
    TestComplex::Sub* submsg = msg.mutable_submessage();
    submsg->set_s("foobar");

    write_to_file(msg, "data-minimal.pbf");

    msg.add_u(22);
    msg.add_u(44);
    msg.set_i(-9876543);

    write_to_file(msg, "data-some.pbf");

    msg.set_s("optionalstring");
    msg.add_u(44);
    msg.add_u(66);
    msg.add_u(66);
    msg.add_d(-17);
    msg.add_d(22);
    msg.set_j(555555555);

    write_to_file(msg, "data-all.pbf");
}