From 6a7dd6fcd95cb6086e447d1897bed750bceee8c2 Mon Sep 17 00:00:00 2001 From: Sakura286 Date: Mon, 21 Oct 2024 12:49:05 +0800 Subject: [PATCH] tdf#152943: Add NaN payload check at the start of sc_ucalc test sequence Some archs does not support NaN payload(e.g. riscv64). It would be meaningless to continue building a test related to NaN payload if the builder doesn't support this feature. Change-Id: I895a8647bf7ff68f645faa7428d30b1c741669f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175293 Tested-by: Jenkins Reviewed-by: Eike Rathke --- sc/CppunitTest_sc_ucalc_nanpayload.mk | 14 ++++++++++++++ sc/Module_sc.mk | 1 + sc/qa/unit/ucalc_nanpayload.cxx | 27 +++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 sc/CppunitTest_sc_ucalc_nanpayload.mk create mode 100644 sc/qa/unit/ucalc_nanpayload.cxx diff --git a/sc/CppunitTest_sc_ucalc_nanpayload.mk b/sc/CppunitTest_sc_ucalc_nanpayload.mk new file mode 100644 index 000000000000..08900a217f6d --- /dev/null +++ b/sc/CppunitTest_sc_ucalc_nanpayload.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +#************************************************************************* + +$(eval $(call sc_ucalc_test,_nanpayload)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 4d9f7c9618a6..63dc4b92b90d 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -43,6 +43,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\ Library_scqahelper \ $(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \ CppunitTest_sc_ucalc) \ + CppunitTest_sc_ucalc_nanpayload \ CppunitTest_sc_ucalc_condformat \ CppunitTest_sc_ucalc_copypaste \ CppunitTest_sc_ucalc_datatransformation \ diff --git a/sc/qa/unit/ucalc_nanpayload.cxx b/sc/qa/unit/ucalc_nanpayload.cxx new file mode 100644 index 000000000000..c64acd3f5bf4 --- /dev/null +++ b/sc/qa/unit/ucalc_nanpayload.cxx @@ -0,0 +1,27 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "helper/qahelper.hxx" +#include + +class TestNanPayload : public ScUcalcTestBase +{ +}; + +CPPUNIT_TEST_FIXTURE(TestNanPayload, testNanPayload) +{ + // Some tests, such as testExternalRefFunctions, testFuncGCD, and testFuncGCD, evaluates + // spreadsheet functions' error code, which need NaN payload feature of the hardware + NanPayloadTest nanTest; + CPPUNIT_ASSERT_MESSAGE(nanTest.getMessage(), nanTest.getIfSupported()); +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */