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 (25 lines) | stat: -rw-r--r-- 459 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

#include <testcase.hpp>

#include "testcase.pb.h"

int main() {
    TestBytes::Test msg;

    msg.set_s("");
    write_to_file(msg, "data-empty.pbf");

    msg.set_s("x");
    write_to_file(msg, "data-one.pbf");

    msg.set_s("foobar");
    write_to_file(msg, "data-string.pbf");

    std::string data;
    data.append(1, char(1));
    data.append(1, char(2));
    data.append(1, char(3));
    msg.set_s(data);
    write_to_file(msg, "data-binary.pbf");
}