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 Jan 25, 2024
1 parent 769f9c4 commit 7d7655e
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 101 deletions.
25 changes: 6 additions & 19 deletions src/CIface_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@

#include "gz/transport/CIface.h"

#include "test_utils.hh"
#include <gz/utils/Environment.hh>

#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();
}
1 change: 1 addition & 0 deletions src/Clock_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "gz/transport/Clock.hh"
#include "gz/transport/Node.hh"
#include "gz/transport/TransportTypes.hh"

#include "gtest/gtest.h"

using namespace gz;
Expand Down
Loading

0 comments on commit 7d7655e

Please sign in to comment.