Skip to content

Commit

Permalink
Cleanup more main functions
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Dec 1, 2023
1 parent 846193d commit 46e16a5
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 101 deletions.
23 changes: 5 additions & 18 deletions src/CIface_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
#include <gz/utils/Environment.hh>

#include "gtest/gtest.h"

#include "test_utils.hh"

using CIfaceTest = testing::PartitionedTransportTest;

static int count;

//////////////////////////////////////////////////
Expand Down Expand Up @@ -58,7 +61,7 @@ void cbNonConst(char *_data, size_t _size, char *_msgType, void *_userData)
}

//////////////////////////////////////////////////
TEST(CIfaceTest, PubSub)
TEST_F(CIfaceTest, PubSub)
{
count = 0;
GzTransportNode *node = gzTransportNodeCreate(nullptr);
Expand Down Expand Up @@ -114,7 +117,7 @@ TEST(CIfaceTest, PubSub)
}

//////////////////////////////////////////////////
TEST(CIfaceTest, PubSubPartitions)
TEST_F(CIfaceTest, PubSubPartitions)
{
count = 0;
GzTransportNode *node = gzTransportNodeCreate(nullptr);
Expand Down Expand Up @@ -175,19 +178,3 @@ TEST(CIfaceTest, PubSubPartitions)
gzTransportNodeDestroy(&nodeBar);
EXPECT_EQ(nullptr, nodeBar);
}

//////////////////////////////////////////////////
int main(int argc, char **argv)
{
// Get a random partition name.
std::string partition = testing::getRandomNumber();

// Set the partition name for this process.
gz::utils::setenv("GZ_PARTITION", partition);

// Enable verbose mode.
// gz::utils::setenv("GZ_VERBOSE", "1");

::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
2 changes: 1 addition & 1 deletion src/Clock_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "gz/transport/Clock.hh"
#include "gz/transport/Node.hh"
#include "gz/transport/TransportTypes.hh"
#include "test_config.hh"

#include "gtest/gtest.h"

using namespace gz;
Expand Down
Loading

0 comments on commit 46e16a5

Please sign in to comment.