From 5cc0010ad93868ec03248e4ac814272bc7d607bc Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
Date: Fri, 19 Sep 2025 22:50:54 +0200
Subject: [PATCH] tests: Fix test guard for test related to allocation tracking

CVE: CVE-2025-59375
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/5cc0010ad93868ec03248e4ac814272bc7d607bc]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
 tests/alloc_tests.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/alloc_tests.c b/tests/alloc_tests.c
index dabdf0da..045447b0 100644
--- a/tests/alloc_tests.c
+++ b/tests/alloc_tests.c
@@ -2362,14 +2362,12 @@ make_alloc_test_case(Suite *s) {
   tcase_add_test__ifdef_xml_dtd(
       tc_alloc, test_alloc_reset_after_external_entity_parser_create_fail);
 
-  tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_size_recorded);
-  tcase_add_test__ifdef_xml_dtd(tc_alloc,
-                                test_alloc_tracker_maximum_amplification);
-  tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_threshold);
-  tcase_add_test__ifdef_xml_dtd(tc_alloc,
-                                test_alloc_tracker_getbuffer_unlimited);
-  tcase_add_test__ifdef_xml_dtd(tc_alloc, test_alloc_tracker_api);
+  tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_size_recorded);
+  tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_maximum_amplification);
+  tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_threshold);
+  tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_getbuffer_unlimited);
+  tcase_add_test__if_xml_ge(tc_alloc, test_alloc_tracker_api);
 
   tcase_add_test(tc_alloc, test_mem_api_cycle);
-  tcase_add_test__ifdef_xml_dtd(tc_alloc, test_mem_api_unlimited);
+  tcase_add_test__if_xml_ge(tc_alloc, test_mem_api_unlimited);
 }
