Skip to content

Commit 4058dde

Browse files
authored
ReaderBase_Tests: 100% internal coverage (#462)
1 parent bf55eec commit 4058dde

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/ReaderBase_Tests.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ TEST(ReaderBase_Derived_Class)
4949
std::shared_ptr<Frame> GetFrame(int64_t number) { std::shared_ptr<Frame> f(new Frame()); return f; }
5050
void Close() { };
5151
void Open() { };
52-
string Json() const { return NULL; };
52+
string Json() const { return ""; };
5353
void SetJson(string value) { };
54-
Json::Value JsonValue() const { return (int) NULL; };
54+
Json::Value JsonValue() const { return Json::Value("{}"); };
5555
void SetJsonValue(Json::Value root) { };
5656
bool IsOpen() { return true; };
5757
string Name() { return "TestReader"; };
@@ -60,6 +60,23 @@ TEST(ReaderBase_Derived_Class)
6060
// Create an instance of the derived class
6161
TestReader t1;
6262

63+
// Validate the new class
64+
CHECK_EQUAL("TestReader", t1.Name());
65+
66+
t1.Close();
67+
t1.Open();
68+
CHECK_EQUAL(true, t1.IsOpen());
69+
70+
CHECK_EQUAL(true, t1.GetCache() == NULL);
71+
72+
t1.SetJson("{ }");
73+
t1.SetJsonValue(Json::Value("{}"));
74+
CHECK_EQUAL("", t1.Json());
75+
auto json = t1.JsonValue();
76+
CHECK_EQUAL(json, Json::Value("{}"));
77+
78+
auto f = t1.GetFrame(1);
79+
6380
// Check some of the default values of the FileInfo struct on the base class
6481
CHECK_EQUAL(false, t1.info.has_audio);
6582
CHECK_EQUAL(false, t1.info.has_audio);

0 commit comments

Comments
 (0)