You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Tests: test << for Coordinate, Fraction, Point
This commit is contained in:
@@ -32,6 +32,10 @@
|
||||
|
||||
#include "Fraction.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
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)");
|
||||
}
|
||||
|
||||
@@ -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)");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user