diff options
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/osl/process/osl_process.cxx | 3 | ||||
-rw-r--r-- | sal/qa/rtl/math/test_rtl_math.cxx | 5 | ||||
-rw-r--r-- | sal/qa/rtl/oustring/rtl_OUString2.cxx | 2 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_convert.cxx | 3 | ||||
-rw-r--r-- | sal/qa/rtl/strings/test_oustring_endswith.cxx | 3 |
5 files changed, 10 insertions, 6 deletions
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx index 35b96bdda..656723015 100644 --- a/sal/qa/osl/process/osl_process.cxx +++ b/sal/qa/osl/process/osl_process.cxx @@ -40,6 +40,7 @@ #include <stdio.h> #include <stdlib.h> #include <osl/module.hxx> +#include <sal/macros.h> #if ( defined WNT ) // Windows #include <tools/prewin.h> @@ -569,7 +570,7 @@ public: NULL, suCWD.pData, child_env, - sizeof(child_env)/sizeof(child_env[0]), + SAL_N_ELEMENTS(child_env), &process); CPPUNIT_ASSERT_MESSAGE diff --git a/sal/qa/rtl/math/test_rtl_math.cxx b/sal/qa/rtl/math/test_rtl_math.cxx index 986838166..2dc2ffd8f 100644 --- a/sal/qa/rtl/math/test_rtl_math.cxx +++ b/sal/qa/rtl/math/test_rtl_math.cxx @@ -38,6 +38,7 @@ #include <testshl/tresstatewrapper.hxx> #include "rtl/ustring.hxx" #include "sal/types.h" +#include <sal/macros.h> #include <stdlib.h> @@ -533,7 +534,7 @@ extern "C" sal_Bool SAL_CALL test_rtl_math(hTestResult pTestResult) { 1.0000000000000002220446049250313080847263336181640625, rtl_math_StringFormat_F, 53, '.', false, "1.00000000000000000000000000000000000000000000000000000" } }; - size_t const nCount = sizeof aTest / sizeof aTest[0]; + size_t const nCount = SAL_N_ELEMENTS(aTest); //LLA: the float tests are wrong here, due to the fact that // we calculate with too less digits after the point @@ -645,7 +646,7 @@ extern "C" sal_Bool SAL_CALL test_rtl_math(hTestResult pTestResult) { "3.14E2000", rtl_math_StringFormat_E, 4, '.', false, "1.#INF" }, }; - size_t const nCount = sizeof aTest / sizeof aTest[0]; + size_t const nCount = SAL_N_ELEMENTS(aTest); bReturn &= testStringToNumberToString< StringTraits >( pTestResult, aTest, nCount); bReturn &= testStringToNumberToString< UStringTraits >( diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx index 05516c7b9..e3877a1b0 100644 --- a/sal/qa/rtl/oustring/rtl_OUString2.cxx +++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx @@ -986,7 +986,7 @@ void convertToString::test() { static sal_Unicode const utf16[] = { 0x0041, 0x00E4, 0x0061 }; rtl::OString s; CPPUNIT_ASSERT( - rtl::OUString(utf16, sizeof utf16 / sizeof utf16[0]).convertToString( + rtl::OUString(utf16, SAL_N_ELEMENTS(utf16)).convertToString( &s, RTL_TEXTENCODING_UTF7, (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))); diff --git a/sal/qa/rtl/strings/test_oustring_convert.cxx b/sal/qa/rtl/strings/test_oustring_convert.cxx index f0e04349d..c0705e255 100644 --- a/sal/qa/rtl/strings/test_oustring_convert.cxx +++ b/sal/qa/rtl/strings/test_oustring_convert.cxx @@ -33,6 +33,7 @@ #include "rtl/strbuf.hxx" #include "rtl/string.hxx" #include "rtl/ustring.hxx" +#include <sal/macros.h> namespace test { namespace oustring { @@ -180,7 +181,7 @@ void test::oustring::Convert::convertToString() OUSTRING_TO_OSTRING_CVTFLAGS, "A?B", "A?B" } }; - for (unsigned int i = 0; i < sizeof aTests / sizeof aTests[0]; ++i) + for (unsigned int i = 0; i < SAL_N_ELEMENTS(aTests); ++i) testConvertToString(aTests[i]); } diff --git a/sal/qa/rtl/strings/test_oustring_endswith.cxx b/sal/qa/rtl/strings/test_oustring_endswith.cxx index b4dc26ade..4f2ae1fa8 100644 --- a/sal/qa/rtl/strings/test_oustring_endswith.cxx +++ b/sal/qa/rtl/strings/test_oustring_endswith.cxx @@ -36,6 +36,7 @@ #include "rtl/textenc.h" #include "rtl/ustring.hxx" #include "sal/types.h" +#include <sal/macros.h> namespace test { namespace oustring { @@ -103,7 +104,7 @@ void test::oustring::EndsWith::endsWith() RTL_CONSTASCII_STRINGPARAM("b\0c"), true }, { RTL_CONSTASCII_STRINGPARAM("a\0b\0c"), RTL_CONSTASCII_STRINGPARAM("b"), false } }; - for (int i = 0; i < sizeof data / sizeof data[0]; ++i) { + for (int i = 0; i < SAL_N_ELEMENTS(data); ++i) { rtl::OStringBuffer msg; appendString(msg, rtl::OString(data[i].str1, data[i].str1Len)); msg.append( |