- open/seek/read/write: may not call finished (only error)
- close: must reach finality (finished or error)
Details
- Reviewers
dfaure
when trying to play from sftp in dragonplayer the broken slave implodes
Diff Detail
- Repository
- R241 KIO
- Branch
- assert-file
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 15752 Build 15770: arc lint + arc unit
I do wonder if maybe it would make sense to revise the verification system to be based off of a list of allowed/forbidden functions that may be called during a command.
e.g. for open the requirements are actually more complicated than this diff establishes. It should be: CMD_OPEN must result in exactly 1 opened() call OR exactly 1 error() call AND must not ever call finished(). This is a less specific variant of what m_finalityCommand represents. Where m_finalityCommand simply marks a command as allowed/forbidden to call error and finished, a more dynamic system would allow us to tightly control different calls.
Simply put: Any given command has 0:N functions it may or may not call. And currently we have no system to codify that.
So maybe something like this would make sense:
void validateCall(QString name) { q_assert(m_CurrentlyAllowedCalls.include?(name), "mustn't call this function"); } void opened() { validateCall("opened"); ... } void finished() { validateCall("finished"); ... }
Replaced by D24887 which instead creates a more generic system to verify slave behavior.