Fix faulty number of new words counting
ClosedPublic

Authored by hriesenbeck on Nov 26 2018, 8:55 PM.

Details

Summary

The configurable number of new words per practice session was not
counted correctly for gender, conjugation and comparison practice.
The above mentioned practice modes uses separate (pre-)grades for the
special word type subsets. These were not recognized by the old
counting algorithm. An improved practice mode dependent (pre-)grade
detection was introduced.

Diff Detail

Repository
R340 Parley
Branch
fix_max_number_of_new_words_for_review (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 11575
Build 11593: arc lint + arc unit
hriesenbeck created this revision.Nov 26 2018, 8:55 PM
Restricted Application added a project: KDE Edu. · View Herald TranscriptNov 26 2018, 8:55 PM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
hriesenbeck requested review of this revision.Nov 26 2018, 8:55 PM

Missed to set a reviewer.

aacid added a subscriber: aacid.Apr 28 2019, 4:11 PM

parley have a few autotests in the autotests folder.

Can you have a look to see if it would not be terribly hard adding an autotest for this?

hriesenbeck updated this revision to Diff 57609.May 5 2019, 7:59 PM
  • Autotests for bugfix were added

TestEntryTest is checking the new added methods in parles TestEntry
class. Because the behaviour of the new methods depends on parleys
current practice mode, the methods are called in all affected practice
modes.

SessionManagerFixedTest is aimed on the bug. The test is failing with
current master checkout and succeeding after applying the bugfix.

During the creation of the unit tests a failure in the bugfix showed
up and was corrected.

Unnecessary debug output, which disturbed the unit test output was
commented out.

hriesenbeck added inline comments.May 5 2019, 8:04 PM
autotests/sessionmanagerfixedtest.cpp
215

This writes to parleys config file. If this is not allowed in automated testing, the sub test for conjugation practice mode has to be removed.
The writing to config file is necessary because parley EntryFilter class loads the document specific preferences from disk. The tenses for conjugation practice are document specific and needed for this test.

aacid added inline comments.May 16 2019, 9:16 PM
autotests/sessionmanagerfixedtest.cpp
215

right, changing peoples config when running tests is bad, but this should be hopefully be fixed by calling

QStandardPaths::setTestModeEnabled(true);

in initTestCase.

Should the same be done for testentrytest.cpp ?

  • Prevent writing to config file while unit test run

    Thanks for the hint with QStandardPaths::setTestModeEnabled(true) It works fine. Added it for testentrytest.cpp too, although it's not necessary there - just to make it bulletproof.

I'm not going to pretend i understand the code, but you wrote lots of unittests, so that's good, let's get this in :)

aacid accepted this revision.May 21 2019, 10:22 PM
This revision is now accepted and ready to land.May 21 2019, 10:22 PM
aacid closed this revision.May 21 2019, 10:22 PM