1
Programming / Re: Qt6 Application Testing
« on: January 10, 2025, 04:42:05 am »
Hi/2.
This is wrong, because 'x:/' is determined as a relative path. Correct is like:
If fp.at(2) != u'/' is used, 'x:dir' style, which is a drive-relative path, is determined as a relative path. BTW, some codes making an absolute path concatenate a relative path to a current path. In this case, 'x:dir' is appended to a current path like '/curdir/x:dir', which is wrong. So a drive-relative path should not be treated as a relative path.
Code: [Select]
return fp.isEmpty() || (fp.at(1) != u':' && fp.at(2) != u'/') || fp.at(0) != u'/';
This is wrong, because 'x:/' is determined as a relative path. Correct is like:
Code: [Select]
return fp.isEmpty() || (fp.at(0) != u'/' && fp.at(1) != u':')
If fp.at(2) != u'/' is used, 'x:dir' style, which is a drive-relative path, is determined as a relative path. BTW, some codes making an absolute path concatenate a relative path to a current path. In this case, 'x:dir' is appended to a current path like '/curdir/x:dir', which is wrong. So a drive-relative path should not be treated as a relative path.