Skip to content

Commit

Permalink
compile
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos committed May 23, 2024
1 parent 0ddfefa commit 64e1127
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/struct_pb/tests/unittest_proto3.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,28 @@ REFLECTION(bench_int32, a, b, c, d);

} // namespace stpb

inline auto create_person() {
stpb::person p{0, 432798, std::string(1024, 'A'), 24, 65536.42};
return p;
}

inline stpb::Monster create_sp_monster() {
stpb::Monster m = {
0,
{0, 1, 2, 3},
16,
24,
"it is a test",
"\1\2\3\4",
stpb::Color::Red,
{{0, "gun", 42}, {0, "shotgun", 56}},
{0, "air craft", 67},
{{0, 7, 8, 9}, {0, 71, 81, 91}},
};
return m;
}

#if defined(STRUCT_PB_WITH_PROTO)
namespace protobuf_sample {
inline mygame::person create_person() {
mygame::person p;
Expand Down Expand Up @@ -251,28 +273,6 @@ inline mygame::Monster create_monster() {
}
} // namespace protobuf_sample

inline auto create_person() {
stpb::person p{0, 432798, std::string(1024, 'A'), 24, 65536.42};
return p;
}

inline stpb::Monster create_sp_monster() {
stpb::Monster m = {
0,
{0, 1, 2, 3},
16,
24,
"it is a test",
"\1\2\3\4",
stpb::Color::Red,
{{0, "gun", 42}, {0, "shotgun", 56}},
{0, "air craft", 67},
{{0, 7, 8, 9}, {0, 71, 81, 91}},
};
return m;
}

#if defined(STRUCT_PB_WITH_PROTO)
void SetBaseTypeMsg(const stpb::BaseTypeMsg& st, pb::BaseTypeMsg& msg) {
msg.set_optional_int32(st.optional_int32);
msg.set_optional_int64(st.optional_int64);
Expand Down

0 comments on commit 64e1127

Please sign in to comment.