File: upstream_Adapt-XML-validation-tests-to-libxml2-2.15.patch

package info (click to toggle)
tellico 4.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 29,064 kB
  • sloc: cpp: 89,088; xml: 35,338; ansic: 7,011; javascript: 3,059; python: 302; perl: 36; ada: 32; sh: 28; makefile: 13
file content (53 lines) | stat: -rw-r--r-- 2,446 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From beaa6edc3cd44536bfe0ae73a4685b581693ea76 Mon Sep 17 00:00:00 2001
From: Pino Toscano <pino@kde.org>
Date: Mon, 27 Oct 2025 12:37:34 +0100
Subject: [PATCH] Adapt XML validation tests to libxml2 2.15
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It looks like libxml2 2.15 enhances the validation check done by
xmlValidateNCName() (used by the helpers in Tellico::XML), accepting
also the character "€" (i.e. EURO SIGN). Considering that "ě"
(i.e. LATIN SMALL LETTER E WITH CARON) was already accepted, this seems
a valid behaviour change.

Hence tweak the test a bit, providing slightly different test data for
the newer libxml2 version, including the EURO sign as valid character.
---
 src/tests/tellicoreadtest.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/tests/tellicoreadtest.cpp b/src/tests/tellicoreadtest.cpp
index cb2e1253e..db1d515b2 100644
--- a/src/tests/tellicoreadtest.cpp
+++ b/src/tests/tellicoreadtest.cpp
@@ -596,7 +596,11 @@ void TellicoReadTest::testXmlName_data() {
   QTest::newRow("colon:") << false << QSL("colon:") << QSL("colon");
   QTest::newRow("Svět")   << true  << QSL("Svět")   << QSL("Svět");
   QTest::newRow("<test>") << false << QSL("<test>") << QSL("test");
+#if LIBXML_VERSION >= 21500
+  QTest::newRow("is-€:")  << false << QSL("is-€:")  << QSL("is-€");
+#else
   QTest::newRow("is-€:")  << false << QSL("is-€:")  << QSL("is-");
+#endif
 }
 
 void TellicoReadTest::testRecoverXmlName() {
@@ -618,8 +622,13 @@ void TellicoReadTest::testRecoverXmlName_data() {
                            << QByteArray("<fields><field name=\"nr\"/></fields><nrs><nr>x</nr></nrs>");
   QTest::newRow("<nr:>4")  << QByteArray("<fields><field d=\"nr:\" name=\"nr:\" d=\"nr:\"/></fields><nr:>x</nr:>")
                            << QByteArray("<fields><field d=\"nr:\" name=\"nr\" d=\"nr:\"/></fields><nr>x</nr>");
+#if LIBXML_VERSION >= 21500
+  QTest::newRow("<is-€:>") << QByteArray("<fields><field name=\"is-€:\"/></fields><is-€:>x</is-€:>")
+                           << QByteArray("<fields><field name=\"is-€\"/></fields><is-€>x</is-€>");
+#else
   QTest::newRow("<is-€:>") << QByteArray("<fields><field name=\"is-€:\"/></fields><is-€:>x</is-€:>")
                            << QByteArray("<fields><field name=\"is-\"/></fields><is->x</is->");
+#endif
 }
 
 void TellicoReadTest::testBug418067() {
-- 
2.51.0