• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2023 Google LLC.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 /* Test of mini table accessors.
9  *
10  * Messages are created and mutated using generated code, and then
11  * accessed through reflective APIs exposed through mini table accessors.
12  */
13 
14 #include "upb/mini_table/compat.h"
15 
16 #include <gtest/gtest.h>
17 #include "google/protobuf/test_messages_proto2.upb_minitable.h"
18 #include "google/protobuf/test_messages_proto3.upb_minitable.h"
19 
20 namespace {
21 
TEST(GeneratedCode,EqualsTestProto2)22 TEST(GeneratedCode, EqualsTestProto2) {
23   EXPECT_TRUE(upb_MiniTable_Equals(
24       &protobuf_0test_0messages__proto2__ProtoWithKeywords_msg_init,
25       &protobuf_0test_0messages__proto2__ProtoWithKeywords_msg_init));
26 }
27 
TEST(GeneratedCode,EqualsTestProto3)28 TEST(GeneratedCode, EqualsTestProto3) {
29   EXPECT_TRUE(upb_MiniTable_Equals(
30       &protobuf_0test_0messages__proto3__TestAllTypesProto3_msg_init,
31       &protobuf_0test_0messages__proto3__TestAllTypesProto3_msg_init));
32 }
33 
34 }  // namespace
35