diff --git a/tests/Fraction.cpp b/tests/Fraction.cpp index 8736abaf..57d37a79 100644 --- a/tests/Fraction.cpp +++ b/tests/Fraction.cpp @@ -32,6 +32,10 @@ #include "Fraction.h" +#include +#include +#include + using namespace std; using namespace openshot; @@ -148,3 +152,12 @@ TEST_CASE( "Reciprocal", "[libopenshot][fraction]" ) CHECK(f1.ToFloat() == Approx(1.77777f).margin(0.00001)); CHECK(f1.ToDouble() == Approx(1.77777f).margin(0.00001)); } + +TEST_CASE( "Operator ostream", "[libopenshot][fraction]" ) +{ + std::stringstream output; + openshot::Fraction f3(30000, 1001); + + output << f3; + CHECK(output.str() == "Fraction(30000, 1001)"); +} diff --git a/tests/Point.cpp b/tests/Point.cpp index 6d53f65b..f4e7792b 100644 --- a/tests/Point.cpp +++ b/tests/Point.cpp @@ -188,3 +188,26 @@ TEST_CASE( "SetJson", "[libopenshot][point]" ) CHECK(p1.handle_type == openshot::HandleType::MANUAL); CHECK(p1.interpolation == openshot::InterpolationType::CONSTANT); } + + +TEST_CASE( "Operator ostream", "[libopenshot][point]" ) +{ + openshot::Coordinate c1(10, 5); + + std::stringstream output1; + openshot::Point p1(c1, openshot::InterpolationType::LINEAR); + output1 << p1; + CHECK(output1.str() == "co(10, 5) interpolation(LINEAR)"); + + std::stringstream output2; + openshot::Point p2(c1, openshot::InterpolationType::CONSTANT); + output2 << p2; + CHECK(output2.str() == "co(10, 5) interpolation(CONSTANT)"); + + std::stringstream output3; + openshot::Point p3(c1, openshot::InterpolationType::BEZIER); + output3 << p3; + CHECK( + output3.str() == + "co(10, 5) interpolation(BEZIER) handle_left(0.5, 1) handle_right(0.5, 0)"); +}