Fix tests, fix doc build, fix one bug

Not all test cases would be possible to bring in sync with current implementation with just a reasonable effort - see uses of QEXPECT_FAIL
I agree.  Are the lines below the first QCOMPARE commented out purely because they are also testing the same condition as the first QCOMPARE?