Skip to content

Commit

Permalink
remove some of api types to corresponding modules v2
Browse files Browse the repository at this point in the history
  • Loading branch information
cieslarmichal committed Nov 18, 2023
1 parent 87998c7 commit 6484d60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/modules/internet/Internet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ std::string Internet::httpMediaType()

std::string Internet::ipv4(IPv4Class ipv4class)
{
IPv4Address sectors;
std::array<unsigned int, 4> sectors{};

sectors[3] = Number::integer<unsigned int>(ipv4SectorUpperBound);
sectors[2] = Number::integer<unsigned int>(ipv4SectorUpperBound);
Expand Down
8 changes: 4 additions & 4 deletions src/modules/internet/InternetTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ constexpr unsigned int classBSecondSectionUpperBound = 31;
constexpr unsigned int classCFirstSection = 192u;
constexpr unsigned int classCSecondSection = 168u;

IPv4Address deconstructIpv4String(const std::string& ipv4)
std::array<unsigned int, 4> deconstructIpv4String(const std::string& ipv4)
{
IPv4Address result;
std::array<unsigned int, 4> result;

std::istringstream ss(ipv4);

Expand Down Expand Up @@ -604,8 +604,8 @@ TEST_F(InternetTest, shouldGenerateIpv4WithPrivateClassCAddress)

TEST_F(InternetTest, shouldGenerateIpv4KeepingTheMaskedPart)
{
const IPv4Address sampleAddress = {192, 168, 10, 12};
const IPv4Address generationMask = {255, 128, 0, 0};
const std::array<unsigned int, 4> sampleAddress = {192, 168, 10, 12};
const std::array<unsigned int, 4> generationMask = {255, 128, 0, 0};

const auto generatedAddress = deconstructIpv4String(Internet::ipv4(sampleAddress, generationMask));

Expand Down

0 comments on commit 6484d60

Please sign in to comment.