Skip to content

Commit

Permalink
update .proto namespace for hpb_generator/tests
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 651523466
  • Loading branch information
honglooker authored and copybara-github committed Jul 11, 2024
1 parent b8cb34d commit 5f366b3
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 28 deletions.
4 changes: 2 additions & 2 deletions hpb/extension_lock_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define EXPECT_OK(x) EXPECT_TRUE(x.ok())
#endif // EXPECT_OK

namespace protos_generator::test::protos {
namespace hpb_unittest::protos {

namespace {

Expand Down Expand Up @@ -121,4 +121,4 @@ TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothEager) {
}

} // namespace
} // namespace protos_generator::test::protos
} // namespace hpb_unittest::protos
11 changes: 5 additions & 6 deletions hpb/internal_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@
#include "google/protobuf/compiler/hpb/tests/test_model.upb.proto.h"
#include "upb/mem/arena.h"

namespace protos::testing {
namespace hpb::testing {
namespace {
using ::protos_generator::test::protos::TestModel;
using ::hpb_unittest::protos::TestModel;

TEST(CppGeneratedCode, InternalMoveMessage) {
// Generate message (simulating message created in another VM/language)
upb_Arena* source_arena = upb_Arena_New();
protos_generator_test_TestModel* message =
protos_generator_test_TestModel_new(source_arena);
hpb_unittest_TestModel* message = hpb_unittest_TestModel_new(source_arena);
ASSERT_NE(message, nullptr);
protos_generator_test_TestModel_set_int_value_with_default(message, 123);
hpb_unittest_TestModel_set_int_value_with_default(message, 123);

// Move ownership.
TestModel model = protos::internal::MoveMessage<TestModel>(
Expand All @@ -34,4 +33,4 @@ TEST(CppGeneratedCode, InternalMoveMessage) {
}

} // namespace
} // namespace protos::testing
} // namespace hpb::testing
2 changes: 1 addition & 1 deletion hpb_generator/tests/child_model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

syntax = "proto3";

package protos_generator.test;
package hpb_unittest;

import public "google/protobuf/compiler/hpb/tests/test_enum.proto";

Expand Down
2 changes: 1 addition & 1 deletion hpb_generator/tests/legacy-name.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

syntax = "proto3";

package protos_generator.test;
package hpb_unittest;

// option java_multiple_files = true;

Expand Down
2 changes: 1 addition & 1 deletion hpb_generator/tests/naming_conflict.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

syntax = "proto3";

package protos_generator.test;
package hpb_unittest;

message HasChildCount {
optional HasChildCount has_child_count = 1;
Expand Down
2 changes: 1 addition & 1 deletion hpb_generator/tests/no_package_enum_user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

syntax = "proto2";

package protos_generator.tests;
package hpb_unittest;

import "google/protobuf/compiler/hpb/tests/no_package.proto";

Expand Down
2 changes: 1 addition & 1 deletion hpb_generator/tests/test_enum.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

syntax = "proto3";

package protos_generator.test;
package hpb_unittest;

enum TestEnum {
DEVICE_UNKNOWN = 0;
Expand Down
2 changes: 1 addition & 1 deletion hpb_generator/tests/test_extension.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

syntax = "proto2";

package protos_generator.test.someotherpackage;
package hpb_unittest.someotherpackage;

import "google/protobuf/compiler/hpb/tests/test_model.proto";

Expand Down
26 changes: 13 additions & 13 deletions hpb_generator/tests/test_generated.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@
namespace {

using ::hpb::internal::Requires;
using ::protos_generator::test::protos::ChildModel1;
using ::protos_generator::test::protos::container_ext;
using ::protos_generator::test::protos::ContainerExtension;
using ::protos_generator::test::protos::other_ext;
using ::protos_generator::test::protos::RED;
using ::protos_generator::test::protos::TestEnum;
using ::protos_generator::test::protos::TestModel;
using ::protos_generator::test::protos::TestModel_Category;
using ::protos_generator::test::protos::TestModel_Category_IMAGES;
using ::protos_generator::test::protos::TestModel_Category_NEWS;
using ::protos_generator::test::protos::TestModel_Category_VIDEO;
using ::protos_generator::test::protos::theme;
using ::protos_generator::test::protos::ThemeExtension;
using ::hpb_unittest::protos::ChildModel1;
using ::hpb_unittest::protos::container_ext;
using ::hpb_unittest::protos::ContainerExtension;
using ::hpb_unittest::protos::other_ext;
using ::hpb_unittest::protos::RED;
using ::hpb_unittest::protos::TestEnum;
using ::hpb_unittest::protos::TestModel;
using ::hpb_unittest::protos::TestModel_Category;
using ::hpb_unittest::protos::TestModel_Category_IMAGES;
using ::hpb_unittest::protos::TestModel_Category_NEWS;
using ::hpb_unittest::protos::TestModel_Category_VIDEO;
using ::hpb_unittest::protos::theme;
using ::hpb_unittest::protos::ThemeExtension;
using ::testing::ElementsAre;

TEST(CppGeneratedCode, Constructor) { TestModel test_model; }
Expand Down
2 changes: 1 addition & 1 deletion hpb_generator/tests/test_model.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

syntax = "proto2";

package protos_generator.test;
package hpb_unittest;

import "google/protobuf/compiler/hpb/tests/child_model.proto";

Expand Down

0 comments on commit 5f366b3

Please sign in to comment.