Merge pull request #1307 from arummler/fix-qtests

Fix qtest regarding hash stability
This commit is contained in:
Laurent Trinques
2026-10-04 11:53:43 +02:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
+12
View File
@@ -741,3 +741,15 @@ add_executable(
add_test(NAME tst_xrefpos COMMAND tst_xrefpos)
target_include_directories(tst_xrefpos PRIVATE ${QET_DIR}/sources)
target_link_libraries(tst_xrefpos PRIVATE Qt::Test Qt::Widgets Qt::Xml pugixml::pugixml)
# Qt 6.4.2 writes the attributes of an element in an order that changes from
# one process to the next, so a project saved twice by two runs of the binary
# differs in bytes only (seen on projects without any numbering, too). A fixed
# hash seed makes the order stable; it changes nothing for a newer Qt.
if(Qt6_VERSION VERSION_LESS 6.5.0)
foreach(qet_test tst_resaveunchanged tst_elementautonumids)
if(TEST ${qet_test})
set_tests_properties(${qet_test} PROPERTIES ENVIRONMENT "QT_HASH_SEED=0")
endif()
endforeach()
endif()
+3
View File
@@ -122,6 +122,9 @@ private slots:
// (#973), and a value with accents comes back as it went in.
void singleSpaceValueKept()
{
#if QT_VERSION < QT_VERSION_CHECK(6, 5, 0)
QSKIP("QDomDocument::PreserveSpacingOnlyNodes needs Qt 6.5 (see QETProject::openFile)");
#endif
QByteArray xml = read(QStringLiteral(QET_EXAMPLES_DIR "/Projet_vierge.qet"));
QVERIFY(xml.contains("<properties>"));
xml.replace("<properties>",