strcpy and cleanup of configuremac

This commit is contained in:
Erik Frojdh
2019-01-14 15:33:35 +01:00
parent 172c9218d1
commit 991567ba1c
4 changed files with 102 additions and 92 deletions

View File

@@ -93,4 +93,22 @@ TEST_CASE("Convert ip address"){
std::string address = "101.255.103.1";
REQUIRE(sls::stringIpToHex(address) == "65ff6701");
}
TEST_CASE("Remove char from string"){
char str[] = "sometest";
sls::removeChar(str, 'e');
REQUIRE(std::string(str) == "somtst");
}
TEST_CASE("Remove char from empty string"){
char str[50] = {};
sls::removeChar(str, 'e');
REQUIRE(std::string(str) == "");
}
TEST_CASE("Many characters in a row"){
char str[] = "someeequitellll::ongstring";
sls::removeChar(str, 'l');
REQUIRE(std::string(str) == "someeequite::ongstring");
}