OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
viettrungluu
2015/10/20 23:54:36
You should add a file-level comment saying what th
vardhan
2015/10/21 19:29:38
I'll do a file-level comment here, and some in BUI
| |
5 #include "examples/serialization/serialization.mojom.h" | |
6 #include "mojo/public/cpp/bindings/array.h" | |
7 | |
8 int main() { | |
9 mojo::examples::MyStruct in; | |
10 mojo::examples::MyStruct out; | |
11 | |
12 in.a = 1; | |
13 in.b = 2.0f; | |
14 in.c = "hello world!"; | |
15 | |
16 char buf[1000]; | |
17 MOJO_CHECK(in.Serialize(buf, sizeof(buf))); | |
viettrungluu
2015/10/20 23:54:36
You should probably include something for MOJO_CHE
vardhan
2015/10/21 19:29:38
Done.
| |
18 | |
19 out.Deserialize(buf); | |
20 MOJO_CHECK(out.a == 1); | |
21 MOJO_CHECK(out.b == 2.0f); | |
22 MOJO_CHECK(out.c == "hello world!"); | |
23 | |
24 return 0; | |
25 } | |
OLD | NEW |