Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
shekeraoleksandr committed Jul 27, 2023
1 parent 63b964d commit 2abf0cc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
2 changes: 1 addition & 1 deletion include/faker-cxx/Number.h
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,11 @@ class Number
* Number::convertToHex(255) // "ff"
*
*/
static std::string convertToHex(int number);

private:
static std::random_device randomDevice;
static std::mt19937 pseudoRandomGenerator;
static std::string convertToHex(int number);

};
}
1 change: 0 additions & 1 deletion src/modules/internet/InternetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,6 @@ TEST_F(InternetTest, shouldGenerateIpv4KeepingTheMaskedPart)
TEST_F(InternetTest, MacDefaultSeparator)
{
std::string mac = Internet::mac();
std::cout << mac << std::endl;
ASSERT_EQ(mac.size(), 17);

for (size_t i = 0; i < mac.size(); i += 3) {
Expand Down
14 changes: 0 additions & 14 deletions src/modules/number/NumberTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,34 +81,20 @@ TEST_F(NumberTest, HexMethodTest)
{

std::string result = Number::hex();
std::cout << result << std::endl;
ASSERT_EQ(result.size(), 1);
ASSERT_TRUE(std::isxdigit(result[0]));

result = Number::hex(100, 255);
std::cout << result << std::endl;
ASSERT_EQ(result.size(), 2);
ASSERT_TRUE(std::isxdigit(result[0]));
ASSERT_TRUE(std::isxdigit(result[1]));

result = Number::hex(10, 15);
std::cout << result << std::endl;
ASSERT_EQ(result.size(), 1);
ASSERT_TRUE(std::isxdigit(result[0]));

result = Number::hex(30, 40);
std::cout << result << std::endl;
ASSERT_EQ(result.size(), 2);
ASSERT_TRUE(std::isxdigit(result[0]));
ASSERT_TRUE(std::isxdigit(result[1]));
}

TEST_F(NumberTest, ConvertToHexMethodTest)
{
ASSERT_EQ(Number::convertToHex(0), "0");
ASSERT_EQ(Number::convertToHex(9), "9");
ASSERT_EQ(Number::convertToHex(10), "a");
ASSERT_EQ(Number::convertToHex(15), "f");
ASSERT_EQ(Number::convertToHex(16), "10");
ASSERT_EQ(Number::convertToHex(255), "ff");
}

0 comments on commit 2abf0cc

Please sign in to comment.