| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MOJO_PUBLIC_C_BINDINGS_TESTS_TESTING_UTIL_H_ | 5 #ifndef MOJO_PUBLIC_C_TESTS_BINDINGS_TESTING_UTIL_H_ |
| 6 #define MOJO_PUBLIC_C_BINDINGS_TESTS_TESTING_UTIL_H_ | 6 #define MOJO_PUBLIC_C_TESTS_BINDINGS_TESTING_UTIL_H_ |
| 7 | 7 |
| 8 #include <mojo/bindings/buffer.h> | 8 #include <mojo/bindings/buffer.h> |
| 9 #include <mojo/system/handle.h> | 9 #include <mojo/system/handle.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| 11 #include <stdint.h> | 11 #include <stdint.h> |
| 12 #include <string.h> | 12 #include <string.h> |
| 13 | 13 |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 // This will copy the supplied |in_struct| and compare it against the new | 16 // This will copy the supplied |in_struct| and compare it against the new |
| (...skipping 20 matching lines...) Expand all Loading... |
| 37 ASSERT_TRUE(out_struct); | 37 ASSERT_TRUE(out_struct); |
| 38 EXPECT_EQ(in_struct_size, buf->num_bytes_used); | 38 EXPECT_EQ(in_struct_size, buf->num_bytes_used); |
| 39 | 39 |
| 40 encode_fn(in_struct, in_struct_size, NULL); | 40 encode_fn(in_struct, in_struct_size, NULL); |
| 41 encode_fn(out_struct, buf->num_bytes_used, NULL); | 41 encode_fn(out_struct, buf->num_bytes_used, NULL); |
| 42 EXPECT_EQ(0, memcmp(in_struct, out_struct, buf->num_bytes_used)); | 42 EXPECT_EQ(0, memcmp(in_struct, out_struct, buf->num_bytes_used)); |
| 43 | 43 |
| 44 decode_fn(in_struct, in_struct_size, NULL, 0); | 44 decode_fn(in_struct, in_struct_size, NULL, 0); |
| 45 } | 45 } |
| 46 | 46 |
| 47 #endif // MOJO_PUBLIC_C_BINDINGS_TESTS_TESTING_UTIL_H_ | 47 #endif // MOJO_PUBLIC_C_TESTS_BINDINGS_TESTING_UTIL_H_ |
| OLD | NEW |