From 5115db74091cf99054393a7132c46da544ee87e1 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Sat, 19 Nov 2016 00:19:29 -0800 Subject: tests: Fix unused variable warning in some compilers The variable is being assigned to but never read when exceptions are disabled. --- tests/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/main.cpp b/tests/main.cpp index 8eb55ed..712edda 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -190,13 +190,14 @@ int main(int, char** argv) total++; passed += run_test(test, test->_name, custom_allocate); - #ifndef PUGIXML_NO_EXCEPTIONS if (g_memory_fail_triggered) { + // run tests that trigger memory failures twice - with an allocator that returns NULL and with an allocator that throws + #ifndef PUGIXML_NO_EXCEPTIONS total++; passed += run_test(test, (test->_name + std::string(" (throw)")).c_str(), custom_allocate_throw); + #endif } - #endif } unsigned int failed = total - passed; -- cgit v1.2.3