Skip to content

Commit

Permalink
Engraving UTests: more intuitive diffs for failing tests
Browse files Browse the repository at this point in the history
The ref file should be passed as the first argument, and the current output as the second argument, otherwise the '-' and '+' in front of lines are inverted w.r.t. what you would intuitively expect.

(Of course you have those '---' and '+++' lines at the beginning, so you can still easily figure out what's going on, but it's nice if you can use your intuition too.)
  • Loading branch information
cbjeukendrup authored and igorkorsukov committed Dec 26, 2022
1 parent 81d8b62 commit 002fd32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/engraving/utests/utils/scorecomp.cpp
Expand Up @@ -35,15 +35,17 @@ bool ScoreComp::saveCompareScore(Score* score, const String& saveName, const Str
if (!ScoreRW::saveScore(score, saveName)) {
return false;
}
return compareFiles(saveName, ScoreRW::rootPath() + u"/" + compareWithLocalPath);

return compareFiles(ScoreRW::rootPath() + u"/" + compareWithLocalPath, saveName);
}

bool ScoreComp::saveCompareMimeData(ByteArray mimeData, const String& saveName, const String& compareWithLocalPath)
{
if (!ScoreRW::saveMimeData(mimeData, saveName)) {
return false;
}
return compareFiles(saveName, ScoreRW::rootPath() + u"/" + compareWithLocalPath);

return compareFiles(ScoreRW::rootPath() + u"/" + compareWithLocalPath, saveName);
}

bool ScoreComp::compareFiles(const String& fullPath1, const String& fullPath2)
Expand Down

0 comments on commit 002fd32

Please sign in to comment.