Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: mojo/public/c/tests/bindings/testing_util.h

Issue 2234063002: Move the C bindings tests to the new location. (Closed) Base URL: https://github.com/domokit/mojo.git@work791_mojo_bindings
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « mojo/public/c/tests/bindings/struct_unittest.cc ('k') | mojo/public/c/tests/bindings/union_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698