diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-01-15 15:20:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-01-15 15:20:17 +0000 |
commit | 692840565d0cac3e60f4ba484bf48dfe49f9e862 (patch) | |
tree | cf6b8566b38d182a50f49e0ff5f3e790b0983edd /sal/workben | |
parent | 9d32411a4376953880857e605257ebe82fa3e69f (diff) |
add performance comparison test for equalsAscii group
Diffstat (limited to 'sal/workben')
-rw-r--r-- | sal/workben/measure_oustrings.cxx | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/sal/workben/measure_oustrings.cxx b/sal/workben/measure_oustrings.cxx index dc5fc4e75584..4a4e169deffa 100644 --- a/sal/workben/measure_oustrings.cxx +++ b/sal/workben/measure_oustrings.cxx @@ -140,7 +140,7 @@ SAL_IMPLEMENT_MAIN() } #endif - std::cout << "--Empty Strings--" << std::endl; + std::cout << "--Empty Strings Construction--" << std::endl; TIME ( @@ -154,7 +154,7 @@ SAL_IMPLEMENT_MAIN() rtl::OUString sFoo(rtl::OUString::createFromAscii("")); ) - std::cout << "--Single Chars--" << std::endl; + std::cout << "--Single Chars Construction--" << std::endl; TIME ( @@ -182,7 +182,7 @@ SAL_IMPLEMENT_MAIN() rtl::OUString sFoo(rtl::OUString::createFromAscii("X")); ) - std::cout << "--MultiChar Strings--" << std::endl; + std::cout << "--MultiChar Strings Construction--" << std::endl; #ifdef SAL_DECLARE_UTF16 TIME @@ -204,6 +204,34 @@ SAL_IMPLEMENT_MAIN() rtl::OUString sFoo(rtl::OUString::createFromAscii("XXXXXXXXXXXXXXX")); ) + std::cout << "--Ascii String Comparison--" << std::endl; + + rtl::OUString sCompare(RTL_CONSTASCII_USTRINGPARAM_CLASSIC("XXXXXXXXXXXXXXX")); + + TIME + ( + "rtl::OUString::equalsAsciiL (false)", + sCompare.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("apple")); + ) + + TIME + ( + "rtl::OUString::equalsAscii (false)", + sCompare.equalsAscii("apple"); + ) + + TIME + ( + "rtl::OUString::equalsAsciiL(true)", + sCompare.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("XXXXXXXXXXXXXXX")); + ) + + TIME + ( + "rtl::OUString::equalsAscii (true)", + sCompare.equalsAscii("XXXXXXXXXXXXXXX"); + ) + return 0; } |