You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
34 lines
1.0 KiB
C++
34 lines
1.0 KiB
C++
#include "UnitTest++.h"
|
|
#include "../include/OpenShot.h"
|
|
|
|
using namespace std;
|
|
using namespace openshot;
|
|
|
|
// Since it is not possible to instantiate an abstract class, this test creates
|
|
// a new derived class, in order to test the base class file info struct.
|
|
TEST(FileReaderBase_Derived_Class)
|
|
{
|
|
// Create a new derived class from type FileReaderBase
|
|
class TestReader : public FileReaderBase
|
|
{
|
|
public:
|
|
TestReader() { InitFileInfo(); };
|
|
tr1::shared_ptr<Frame> GetFrame(int number) { tr1::shared_ptr<Frame> f(new Frame()); return f; }
|
|
void Close() { };
|
|
void Open() { };
|
|
};
|
|
|
|
// Create an instance of the derived class
|
|
TestReader t1;
|
|
|
|
// Check some of the default values of the FileInfo struct on the base class
|
|
// If InitFileInfo() is not called in the derived class, these checks would fail.
|
|
CHECK_EQUAL(false, t1.info.has_audio);
|
|
CHECK_EQUAL(false, t1.info.has_audio);
|
|
CHECK_CLOSE(0.0f, t1.info.duration, 0.00001);
|
|
CHECK_EQUAL(0, t1.info.height);
|
|
CHECK_EQUAL(0, t1.info.width);
|
|
CHECK_EQUAL(1, t1.info.fps.num);
|
|
CHECK_EQUAL(1, t1.info.fps.den);
|
|
}
|