Skip to content

Commit

Permalink
tests/Point: Get coverage to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc committed Feb 22, 2021
1 parent 907e48f commit 8aad415
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ TEST_CASE( "SetJson", "[libopenshot][point]" )
{
openshot::Point p1;
std::stringstream json_stream;

// A string that's not JSON should cause an exception
CHECK_THROWS_AS(p1.SetJson("}{"), openshot::InvalidJSON);

// Build a valid JSON string for Point settings
json_stream << R"json(
{
"co": { "X": 1.0, "Y": 0.0 },
Expand All @@ -171,6 +176,7 @@ TEST_CASE( "SetJson", "[libopenshot][point]" )
json_stream << R"json(
}
)json";

p1.SetJson(json_stream.str());
CHECK(p1.handle_left.X == 2.0);
CHECK(p1.handle_left.Y == 3.0);
Expand Down

0 comments on commit 8aad415

Please sign in to comment.