fixes bug "Relative path for audio files not working"

Review Request #130224 - Created Aug. 12, 2017 and updated

René Fritz

description is in bug report

urls like "file:somepath/file.mp3" are parsed correctly again and sound is played

Albert Astals Cid

Looks good, i'm going to go an extra step and ask.

Do you think you could either add an autotest (or improve one of the existing ones) to check this so we don't regress again?

If you think it's too much or need help, just say it :)

  1. Hi,
    Good point
    I'm a developer but totally new to c++, qt, ...
    So writing a test would be a bit too much for now, maybe?

    I don't see how keduvockvtml2reader.cpp could be tested easily. Too much context I guess?

    So testing to read a whole document might be the way to go. I looked into the existing tests. Kvtml2ReaderTest would be the right place I think and creating test entries in the fixture xml is something I could do I guess. But testing the parsed document would mean I understand the KVOCREADER_EXPECT_CORE macro to get access to the parsed document ... which is not the case :-)
    A test example which takes
    XMLGenerator gen;
    and makes
    KEduVocDocument doc;
    out of it would be something I might be able to work with.

  2. You don't really need KVOCREADER_EXPECT_CORE, the only thing that macro does is read the document and check it parsed successfully. You can't have access to the KEduVocDocument it contains.

    Just create a new test_somethingSomething() function in Kvtml2ReaderTest and there declare all variables you need and QCOMPARE/QVERIFY in it