Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReaderBase_Tests: 100% internal coverage #462

Merged
merged 1 commit into from
Mar 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions tests/ReaderBase_Tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ TEST(ReaderBase_Derived_Class)
std::shared_ptr<Frame> GetFrame(int64_t number) { std::shared_ptr<Frame> f(new Frame()); return f; }
void Close() { };
void Open() { };
string Json() const { return NULL; };
string Json() const { return ""; };
void SetJson(string value) { };
Json::Value JsonValue() const { return (int) NULL; };
Json::Value JsonValue() const { return Json::Value("{}"); };
void SetJsonValue(Json::Value root) { };
bool IsOpen() { return true; };
string Name() { return "TestReader"; };
Expand All @@ -60,6 +60,23 @@ TEST(ReaderBase_Derived_Class)
// Create an instance of the derived class
TestReader t1;

// Validate the new class
CHECK_EQUAL("TestReader", t1.Name());

t1.Close();
t1.Open();
CHECK_EQUAL(true, t1.IsOpen());

CHECK_EQUAL(true, t1.GetCache() == NULL);

t1.SetJson("{ }");
t1.SetJsonValue(Json::Value("{}"));
CHECK_EQUAL("", t1.Json());
auto json = t1.JsonValue();
CHECK_EQUAL(json, Json::Value("{}"));

auto f = t1.GetFrame(1);

// Check some of the default values of the FileInfo struct on the base class
CHECK_EQUAL(false, t1.info.has_audio);
CHECK_EQUAL(false, t1.info.has_audio);
Expand Down