Skip to content

Commit

Permalink
Finale: Source hard-tocks
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Jul 19, 2022
1 parent 17bae14 commit 8bb8267
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 169 deletions.
10 changes: 5 additions & 5 deletions src/ComponentFactory_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ TEST_F(ComponentFactoryTest, Register)
// Store number of registered component types
auto registeredCount = factory->TypeIds().size();

factory->Register<MyCustom>("ign_gazebo_components.MyCustom",
factory->Register<MyCustom>("gz_sim_components.MyCustom",
new components::ComponentDescriptor<MyCustom>());

// Check now it has type id
EXPECT_NE(0u, MyCustom::typeId);
EXPECT_EQ("ign_gazebo_components.MyCustom", MyCustom::typeName);
EXPECT_EQ("ign_gazebo_components.MyCustom",
EXPECT_EQ("gz_sim_components.MyCustom", MyCustom::typeName);
EXPECT_EQ("gz_sim_components.MyCustom",
factory->Name(MyCustom::typeId));

// Check factory knows id
Expand All @@ -69,15 +69,15 @@ TEST_F(ComponentFactoryTest, Register)
EXPECT_NE(ids.end(), std::find(ids.begin(), ids.end(), MyCustom::typeId));

// Fail to register same component twice
factory->Register<MyCustom>("ign_gazebo_components.MyCustom",
factory->Register<MyCustom>("gz_sim_components.MyCustom",
new components::ComponentDescriptor<MyCustom>());

EXPECT_EQ(registeredCount + 1, factory->TypeIds().size());

// Fail to register 2 components with same name
using Duplicate = components::Component<components::NoData,
class DuplicateTag>;
factory->Register<Duplicate>("ign_gazebo_components.MyCustom",
factory->Register<Duplicate>("gz_sim_components.MyCustom",
new components::ComponentDescriptor<Duplicate>());

EXPECT_EQ(registeredCount + 1, factory->TypeIds().size());
Expand Down
2 changes: 1 addition & 1 deletion src/Component_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST_F(ComponentTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(DataByMove))
// Create a custom component with shared_ptr data
using CustomComponent =
components::Component<std::shared_ptr<int>, class CustomComponentTag>;
factory->Register<CustomComponent>("ign_gazebo_components.MyCustom",
factory->Register<CustomComponent>("gz_sim_components.MyCustom",
new components::ComponentDescriptor<CustomComponent>());

EntityComponentManager ecm;
Expand Down
16 changes: 8 additions & 8 deletions src/EntityComponentManager_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,39 +50,39 @@ inline namespace GZ_SIM_VERSION_NAMESPACE {
namespace components
{
using IntComponent = components::Component<int, class IntComponentTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.IntComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.IntComponent",
IntComponent)

using UIntComponent = components::Component<int, class IntComponentTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.UIntComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.UIntComponent",
UIntComponent)

using DoubleComponent = components::Component<double, class DoubleComponentTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.DoubleComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.DoubleComponent",
DoubleComponent)

using StringComponent =
components::Component<std::string, class StringComponentTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.StringComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.StringComponent",
StringComponent)

using BoolComponent = components::Component<bool, class BoolComponentTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.BoolComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.BoolComponent",
BoolComponent)

using Even = components::Component<components::NoData, class EvenTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.Even", Even)
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.Even", Even)

using Odd = components::Component<components::NoData, class OddTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.Odd", Odd)
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.Odd", Odd)

struct Custom
{
int dummy{123};
};

using CustomComponent = components::Component<Custom, class CustomTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.CustomComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.CustomComponent",
CustomComponent)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/SimulationRunner_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ inline namespace GZ_SIM_VERSION_NAMESPACE {
namespace components
{
using IntComponent = components::Component<int, class IntComponentTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.IntComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.IntComponent",
IntComponent)

using DoubleComponent = components::Component<double, class DoubleComponentTag>;
GZ_SIM_REGISTER_COMPONENT("ign_gazebo_components.DoubleComponent",
GZ_SIM_REGISTER_COMPONENT("gz_sim_components.DoubleComponent",
DoubleComponent)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/model.yaml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- # Model subcommand available inside Gazebo Sim.
format: 1.0.0
library_name: gz-sim-ign
library_name: gz-sim-gz
library_version: @PROJECT_VERSION_FULL@
library_path: @gz_model_ruby_path@
commands:
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/sim.yaml.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- # Subcommands available inside Gazebo Sim
format: 1.0.0
library_name: gz-sim-ign
library_name: gz-sim-gz
library_version: @PROJECT_VERSION_FULL@
library_path: @gz_library_path@
commands:
Expand Down
Loading

0 comments on commit 8bb8267

Please sign in to comment.