diff options
author | Kunal Pawar <hellokunalpawar@gmail.com> | 2022-02-10 13:20:06 +0530 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2022-02-15 21:00:18 +0100 |
commit | 49746f40b06eaf1f61bb54454408a06a49d73c5e (patch) | |
tree | 3a94fb222ce0bb001f2340372183a1eec36247a4 /stoc | |
parent | 2bf59e3b60a0d5c6ebcd4498f5038d6d2e86db62 (diff) |
tdf#145759 Use symbolic constants instead of magic numerical constants
1.4142... -> M_SQRT2
0.4142... -> M_SQRT2 - 1
3.1415... -> M_PI
2.7182... -> M_E
Change-Id: If5b19aa38d9902b1a4b717f89f18bdf2f73a47cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129745
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/test/testiadapter.cxx | 3 | ||||
-rw-r--r-- | stoc/test/testintrosp.cxx | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx index 1525032d2af3..d9fd9560c13a 100644 --- a/stoc/test/testiadapter.cxx +++ b/stoc/test/testiadapter.cxx @@ -37,6 +37,7 @@ #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <cppuhelper/implbase.hxx> +#include <cmath> using namespace test; @@ -749,7 +750,7 @@ sal_Bool performTest( const Reference<XLanguageBindingTest > & xLBT ) sal_True, '@', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98, SAL_CONST_INT64(0x123456789abcdef0), SAL_CONST_UINT64(0xfedcba9876543210), - (float)17.0815, 3.1415926359, TestEnum_LOLA, OUString("dumdidum"), xI, + (float)17.0815, M_PI, TestEnum_LOLA, OUString("dumdidum"), xI, Any( &xI, cppu::UnoType<XInterface>::get()) ); OSL_ENSURE( aData.Any == xI, "### unexpected any!" ); diff --git a/stoc/test/testintrosp.cxx b/stoc/test/testintrosp.cxx index e33ee178e3e9..0b56c8564ef9 100644 --- a/stoc/test/testintrosp.cxx +++ b/stoc/test/testintrosp.cxx @@ -40,6 +40,7 @@ #include <stdio.h> #include <string.h> +#include <cmath> using namespace cppu; using namespace ModuleA; @@ -454,7 +455,7 @@ void ImplIntroTest::Init() //XInterfaceRef Source; Any Value; - Value <<= 2.718281828459; + Value <<= M_E; m_aSecondStruct.Value = Value; //XIdlClassRef ListenerType; m_aSecondStruct.State = PropertyState_DIRECT_VALUE; |