-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor rewrite to the recording extender test code.
The current code violates the C++ One Definition Rule where only a single declaration of a class is allowed in a translation unit. It was originally written that way to try and minimize the amount of the backend code that had to be linked in to make it compile. Rewrite the code to use a derived class of "Scheduler" instead of a second class named "Scheduler". This satisfies the One Definition Rule while also not requiring a cascading list of object files that need to be linked in to the test code.
- Loading branch information
1 parent
4a33abb
commit b061ec2
Showing
6 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 29 additions & 9 deletions
38
mythtv/programs/mythbackend/test/test_recordingextender/dummyscheduler.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
mythtv/programs/mythbackend/test/test_recordingextender/dummyscheduler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "libmythbase/mthread.h" | ||
#include "../../scheduler.h" | ||
#include "libmythtv/recordinginfo.h" | ||
|
||
class TestScheduler : public Scheduler | ||
{ | ||
public: | ||
TestScheduler() : Scheduler(false, nullptr) {}; | ||
|
||
// These have to match the signatures of the real scheduler. | ||
QMap<QString,ProgramInfo*> GetRecording(void) const override; | ||
RecordingInfo* GetRecording(uint recordedid) const override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters