Added color format tests.
the build was successful Details

This commit is contained in:
tastytea 2019-01-02 11:21:54 +01:00
parent 86e865edfe
commit 55de144050
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 76 additions and 1 deletions

View File

@ -60,6 +60,24 @@ SCENARIO("Please do not crash")
REQUIRE(exception == false);
}
}
WHEN("colors with uppercase hex digits")
{
try
{
Identiconpp identicon(1, 1, Identiconpp::algorithm::sigil,
"FF00FFFF");
identicon.generate(digest);
}
catch (const std::exception &e)
{
exception = true;
}
THEN("Does not crash")
{
REQUIRE(exception == false);
}
}
}
}
@ -181,7 +199,64 @@ SCENARIO("Please crash")
{
Identiconpp identicon(1, 1,
Identiconpp::algorithm::ltr_symmetric,
"ffffffff", { "000000f"});
"ffffffff", { "000000f" });
identicon.generate(digest);
}
catch (const std::exception &e)
{
exception = true;
}
THEN("Crashes")
{
REQUIRE(exception == true);
}
}
WHEN("No foreground color")
{
try
{
Identiconpp identicon(1, 1,
Identiconpp::algorithm::ltr_symmetric,
"ffffffff", {});
identicon.generate(digest);
}
catch (const std::exception &e)
{
exception = true;
}
THEN("Crashes")
{
REQUIRE(exception == true);
}
}
WHEN("Non-hex digits in background color")
{
try
{
Identiconpp identicon(1, 1,
Identiconpp::algorithm::ltr_symmetric,
"ffffffgf");
identicon.generate(digest);
}
catch (const std::exception &e)
{
exception = true;
}
THEN("Crashes")
{
REQUIRE(exception == true);
}
}
WHEN("Non-hex digits in foreground color")
{
try
{
Identiconpp identicon(1, 1,
Identiconpp::algorithm::ltr_symmetric,
"ffffffff", { "g00000ff" });
identicon.generate(digest);
}
catch (const std::exception &e)