Skip to content

Commit

Permalink
ReaderBase_Tests: 100% internal coverage (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdnyc authored Mar 11, 2020
1 parent bf55eec commit 4058dde
Showing 1 changed file with 19 additions and 2 deletions.
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

0 comments on commit 4058dde

Please sign in to comment.