Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / grpc-cloned / deps / grpc / third_party / upb / examples / bazel / test_binary.c
diff --git a/legacy-libs/grpc-cloned/deps/grpc/third_party/upb/examples/bazel/test_binary.c b/legacy-libs/grpc-cloned/deps/grpc/third_party/upb/examples/bazel/test_binary.c
new file mode 100644 (file)
index 0000000..78f367a
--- /dev/null
@@ -0,0 +1,17 @@
+
+#include <time.h>
+
+#include "foo.upb.h"
+
+int main() {
+  upb_arena *arena = upb_arena_new();
+  Foo* foo = Foo_new(arena);
+  const char greeting[] = "Hello, World!\n";
+
+  Foo_set_time(foo, time(NULL));
+  /* Warning: the proto will not copy this, the string data must outlive
+   * the proto. */
+  Foo_set_greeting(foo, upb_strview_makez(greeting));
+
+  upb_arena_free(arena);
+}