summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bridges/source/remote/urp/urp_job.hxx1
-rw-r--r--cppu/source/threadpool/jobqueue.cxx4
-rw-r--r--cppuhelper/inc/cppuhelper/propshlp.hxx35
-rwxr-xr-xcppuhelper/source/cc5_solaris_sparc.map6
-rw-r--r--cppuhelper/source/gcc3.map7
-rw-r--r--cppuhelper/source/msvc_win32_intel.map6
-rw-r--r--cppuhelper/source/propshlp.cxx109
-rw-r--r--jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java13
-rw-r--r--jvmfwk/inc/jvmfwk/framework.h1
-rw-r--r--jvmfwk/inc/jvmfwk/vendorplugin.h19
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx5
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx62
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map5
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx4
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx8
-rw-r--r--jvmfwk/source/elements.cxx10
-rw-r--r--jvmfwk/source/framework.cxx48
-rw-r--r--jvmfwk/source/framework.hxx4
-rw-r--r--offapi/com/sun/star/awt/XDialog2.idl2
-rw-r--r--offapi/com/sun/star/formula/FormulaProperties.idl8
-rw-r--r--offapi/com/sun/star/inspection/LineDescriptor.idl4
-rw-r--r--offapi/com/sun/star/text/DocumentSettings.idl12
-rw-r--r--[-rwxr-xr-x]offapi/com/sun/star/text/TextFrame.idl0
-rw-r--r--offapi/com/sun/star/text/TextMarkupType.idl25
-rw-r--r--offapi/com/sun/star/ui/UIElementType.idl10
-rw-r--r--sal/inc/osl/diagnose.h10
-rw-r--r--sal/inc/rtl/math.h8
-rw-r--r--sal/osl/unx/file_misc.cxx57
-rw-r--r--sal/prj/build.lst1
-rw-r--r--sal/qa/OStringBuffer/makefile.mk2
-rw-r--r--sal/qa/osl/process/makefile.mk2
-rw-r--r--sal/qa/osl/profile/makefile.mk1
-rwxr-xr-xsal/qa/rtl/alloc/makefile.mk2
-rwxr-xr-xsal/qa/rtl/crc32/makefile.mk2
-rw-r--r--sal/qa/rtl/digest/makefile.mk2
-rw-r--r--sal/qa/rtl/doublelock/makefile.mk2
-rw-r--r--sal/qa/rtl/locale/makefile.mk2
-rw-r--r--sal/qa/rtl/math/export.exp1
-rw-r--r--sal/qa/rtl/math/makefile.mk84
-rw-r--r--sal/qa/rtl/math/rtl_math.cxx626
-rw-r--r--sal/qa/rtl/math/rtl_old_testint64.cxx122
-rw-r--r--sal/qa/rtl/math/test-rtl-math.cxx76
-rw-r--r--sal/qa/rtl/math/test_rtl_math.cxx674
-rw-r--r--sal/qa/rtl/random/makefile.mk2
-rw-r--r--sal/qa/rtl_strings/makefile.mk1
-rw-r--r--sal/rtl/source/math.cxx2
-rw-r--r--sal/systools/win32/kill/kill.cxx2
-rw-r--r--sal/textenc/convertiscii.tab2
-rw-r--r--sal/textenc/tencinfo.c5
49 files changed, 477 insertions, 1619 deletions
diff --git a/bridges/source/remote/urp/urp_job.hxx b/bridges/source/remote/urp/urp_job.hxx
index ce58b1f3f779..1bafaf9f5162 100644
--- a/bridges/source/remote/urp/urp_job.hxx
+++ b/bridges/source/remote/urp/urp_job.hxx
@@ -303,6 +303,7 @@ inline ClientJob::ClientJob(
uno_Any **ppException )
: Job(
pEnvRemote, pContext, pBridgeImpl, ::bridges_remote::RTC_HOLDENVWEAK )
+ , m_bExceptionOccured( false )
, m_ppArgs( ppArgs )
, m_pReturn( pReturn )
, m_pInterfaceType( pInterfaceType ) // weak
diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx
index 6029505fe4ee..333a350c0b23 100644
--- a/cppu/source/threadpool/jobqueue.cxx
+++ b/cppu/source/threadpool/jobqueue.cxx
@@ -98,6 +98,10 @@ namespace cppu_threadpool {
if( 0 == m_lstCallstack.front() )
{
// disposed !
+ if( m_lstJob.empty() )
+ {
+ osl_resetCondition( m_cndWait );
+ }
break;
}
diff --git a/cppuhelper/inc/cppuhelper/propshlp.hxx b/cppuhelper/inc/cppuhelper/propshlp.hxx
index 98103e58185b..82bbd2bdcdbe 100644
--- a/cppuhelper/inc/cppuhelper/propshlp.hxx
+++ b/cppuhelper/inc/cppuhelper/propshlp.hxx
@@ -595,6 +595,29 @@ protected:
::com::sun::star::uno::Any& rValue,
sal_Int32 nHandle ) const = 0;
+ /** sets an dependent property's value
+
+ <p>Sometimes setting a given property needs to implicitly modify another property's value. Calling |setPropertyValue|
+ from within |setFastPropertyValue_NoBroadcast| is not an option here, as it would notify the property listeners
+ while our mutex is still locked. Setting the dependent property's value directly (e.g. by calling |setFastPropertyValue_NoBroadcast|
+ recursively) is not an option, too, since it would miss firing the property change event.</p>
+
+ <p>So, in such cases, you use |setDependentFastPropertyValue| from within |setFastPropertyValue_NoBroadcast|.
+ It will convert and actually set the property value (invoking |convertFastPropertyValue| and |setFastPropertyValue_NoBroadcast|
+ for the given handle and value), and add the property change event to the list of events to be notified
+ when the bottom-most |setFastPropertyValue_NoBroadcast| on the stack returns.</p>
+
+ <p><strong>Note</strong>: The method will <em>not</em> invoke veto listeners for the property.</p>
+
+ <p><strong>Note</strong>: It's the caller's responsibility to ensure that our mutex is locked. This is
+ canonically given when the method is invoked from within |setFastPropertyValue_NoBroadcast|, in other
+ contexts, you might need to take own measures.</p>
+ */
+ void setDependentFastPropertyValue(
+ sal_Int32 i_handle,
+ const ::com::sun::star::uno::Any& i_value
+ );
+
/** The common data of a broadcaster. Use the mutex, disposing state and the listener container. */
OBroadcastHelper &rBHelper;
/**
@@ -610,12 +633,22 @@ protected:
/** reserved for future use. finally, the future has arrived...
*/
- const std::auto_ptr<const Impl> m_pReserved;
+ const std::auto_ptr<Impl> m_pReserved;
private:
OPropertySetHelper( const OPropertySetHelper & ) SAL_THROW( () );
OPropertySetHelper & operator = ( const OPropertySetHelper & ) SAL_THROW( () );
+ /** notifies the given changes in property's values, <em>plus</em> all property changes collected during recent
+ |setDependentFastPropertyValue| calls.
+ */
+ void impl_fireAll(
+ sal_Int32* i_handles,
+ const ::com::sun::star::uno::Any * i_newValues,
+ const ::com::sun::star::uno::Any * i_oldValues,
+ sal_Int32 i_count
+ );
+
public:
// Suppress warning about virtual functions but non-virtual destructor:
#if defined __GNUC__
diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map
index d43ea690e11a..5dd703cf9fc9 100755
--- a/cppuhelper/source/cc5_solaris_sparc.map
+++ b/cppuhelper/source/cc5_solaris_sparc.map
@@ -387,3 +387,9 @@ UDK_3.7 { # OOo 3.3
__1cDcomDsunEstarDunoTWeakReferenceHelperFclear6M_v_;
__1cEcppubHcreateOneInstanceComponentFactory6FpFrknDcomDsunEstarDunoJReference4n0ERXComponentContext____n0EJReference4n0EKXInterface___rknDrtlIOUString_rkn0EISequence4n0K___pnQ_rtl_ModuleCount__n0EJReference4n0DElangXXSingleComponentFactory____;
} UDK_3.6;
+
+UDK_3.8 { # OOo 3.4
+ global:
+ __1cEcppuSOPropertySetHelperbDsetDependentFastPropertyValue6MlrknDcomDsunEstarDunoDAny__v_;
+} UDK_3.7;
+
diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 59ab83e34e82..eef6053b7595 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -382,3 +382,10 @@ UDK_3.6 { # OOo 3.3
_ZN4cppu33createOneInstanceComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKNS4_INS3_17XComponentContextEEEERKN3rtl8OUStringERKNS3_8SequenceISE_EEP16_rtl_ModuleCount;
} UDK_3.5;
+
+UDK_3.7 { # OOo 3.4
+ global:
+ _ZN4cppu18OPropertySetHelper29setDependentFastPropertyValueElRKN3com3sun4star3uno3AnyE;
+ _ZN4cppu18OPropertySetHelper29setDependentFastPropertyValueEiRKN3com3sun4star3uno3AnyE;
+} UDK_3.6;
+
diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map
index 6d5a491ab925..7069276e2baa 100644
--- a/cppuhelper/source/msvc_win32_intel.map
+++ b/cppuhelper/source/msvc_win32_intel.map
@@ -278,3 +278,9 @@ UDK_3.6 { # OOo 3.3
?clear@WeakReferenceHelper@uno@star@sun@com@@QAAXXZ;
?createOneInstanceComponentFactory@cppu@@YA?AV?$Reference@VXSingleComponentFactory@lang@star@sun@com@@@uno@star@sun@com@@P6A?AV?$Reference@VXInterface@uno@star@sun@com@@@3456@ABV?$Reference@VXComponentContext@uno@star@sun@com@@@3456@@ZABVOUString@rtl@@ABV?$Sequence@VOUString@rtl@@@3456@PAU_rtl_ModuleCount@@@Z;
} UDK_3.5;
+
+UDK_3.7 { # OOo 3.4
+ global:
+ ?setDependentFastPropertyValue@OPropertySetHelper@cppu@@IAEXJABVAny@uno@star@sun@com@@@Z;
+} UDK_3.6;
+
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index fe455781a1a7..e43f93272e16 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -32,6 +32,7 @@
#include "cppuhelper/implbase1.hxx"
#include "cppuhelper/weak.hxx"
#include "cppuhelper/propshlp.hxx"
+#include "cppuhelper/exc_hlp.hxx"
#include "com/sun/star/beans/PropertyAttribute.hpp"
#include "com/sun/star/lang/DisposedException.hpp"
@@ -144,15 +145,20 @@ sal_Bool OPropertySetHelperInfo_Impl::hasPropertyByName( const OUString & Proper
class OPropertySetHelper::Impl {
public:
- Impl ( bool i_bIgnoreRuntimeExceptionsWhileFiring,
- IEventNotificationHook *i_pFireEvents)
- : m_bIgnoreRuntimeExceptionsWhileFiring(
- i_bIgnoreRuntimeExceptionsWhileFiring ),
- m_pFireEvents( i_pFireEvents )
- { }
+ Impl( bool i_bIgnoreRuntimeExceptionsWhileFiring,
+ IEventNotificationHook *i_pFireEvents
+ )
+ :m_bIgnoreRuntimeExceptionsWhileFiring( i_bIgnoreRuntimeExceptionsWhileFiring )
+ ,m_pFireEvents( i_pFireEvents )
+ {
+ }
bool m_bIgnoreRuntimeExceptionsWhileFiring;
class IEventNotificationHook * const m_pFireEvents;
+
+ ::std::vector< sal_Int32 > m_handles;
+ ::std::vector< Any > m_newValues;
+ ::std::vector< Any > m_oldValues;
};
@@ -432,6 +438,57 @@ void OPropertySetHelper::removeVetoableChangeListener(
}
}
+void OPropertySetHelper::setDependentFastPropertyValue( sal_Int32 i_handle, const ::com::sun::star::uno::Any& i_value )
+{
+ //OSL_PRECOND( rBHelper.rMutex.isAcquired(), "OPropertySetHelper::setDependentFastPropertyValue: to be called with a locked mutex only!" );
+ // there is no such thing as Mutex.isAcquired, sadly ...
+
+ sal_Int16 nAttributes(0);
+ IPropertyArrayHelper& rInfo = getInfoHelper();
+ if ( !rInfo.fillPropertyMembersByHandle( NULL, &nAttributes, i_handle ) )
+ // unknown property
+ throw UnknownPropertyException();
+
+ // no need to check for READONLY-ness of the property. The method is intended to be called internally, which
+ // implies it might be invoked for properties which are read-only to the instance's clients, but well allowed
+ // to change their value.
+
+ Any aConverted, aOld;
+ sal_Bool bChanged = convertFastPropertyValue( aConverted, aOld, i_handle, i_value );
+ if ( !bChanged )
+ return;
+
+ // don't fire vetoable events. This method is called with our mutex locked, so calling into listeners would not be
+ // a good idea. The caler is responsible for not invoking this for constrained properties.
+ OSL_ENSURE( ( nAttributes & PropertyAttribute::CONSTRAINED ) == 0,
+ "OPropertySetHelper::setDependentFastPropertyValue: not to be used for constrained properties!" );
+ (void)nAttributes;
+
+ // actually set the new value
+ try
+ {
+ setFastPropertyValue_NoBroadcast( i_handle, aConverted );
+ }
+ catch (const UnknownPropertyException& ) { throw; /* allowed to leave */ }
+ catch (const PropertyVetoException& ) { throw; /* allowed to leave */ }
+ catch (const IllegalArgumentException& ) { throw; /* allowed to leave */ }
+ catch (const WrappedTargetException& ) { throw; /* allowed to leave */ }
+ catch (const RuntimeException& ) { throw; /* allowed to leave */ }
+ catch (const Exception& )
+ {
+ // not allowed to leave this meathod
+ WrappedTargetException aWrapped;
+ aWrapped.TargetException <<= ::cppu::getCaughtException();
+ aWrapped.Context = static_cast< XPropertySet* >( this );
+ throw aWrapped;
+ }
+
+ // remember the handle/values, for the events to be fired later
+ m_pReserved->m_handles.push_back( i_handle );
+ m_pReserved->m_newValues.push_back( aConverted ); // TODO: setFastPropertyValue notifies the unconverted value here ...?
+ m_pReserved->m_oldValues.push_back( aOld );
+}
+
// XFastPropertySet
void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rValue )
throw(::com::sun::star::beans::UnknownPropertyException,
@@ -498,7 +555,7 @@ void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rVa
// release guard to fire events
}
// file a change event, if the value changed
- fire( &nHandle, &rValue, &aOldVal, 1, sal_False );
+ impl_fireAll( &nHandle, &rValue, &aOldVal, 1 );
}
}
@@ -521,6 +578,42 @@ Any OPropertySetHelper::getFastPropertyValue( sal_Int32 nHandle )
}
//--------------------------------------------------------------------------
+void OPropertySetHelper::impl_fireAll( sal_Int32* i_handles, const Any* i_newValues, const Any* i_oldValues, sal_Int32 i_count )
+{
+ ClearableMutexGuard aGuard( rBHelper.rMutex );
+ if ( m_pReserved->m_handles.empty() )
+ {
+ aGuard.clear();
+ fire( i_handles, i_newValues, i_oldValues, i_count, sal_False );
+ return;
+ }
+
+ const size_t additionalEvents = m_pReserved->m_handles.size();
+ OSL_ENSURE( additionalEvents == m_pReserved->m_newValues.size()
+ && additionalEvents == m_pReserved->m_oldValues.size(),
+ "OPropertySetHelper::impl_fireAll: inconsistency!" );
+
+ ::std::vector< sal_Int32 > allHandles( additionalEvents + i_count );
+ ::std::copy( m_pReserved->m_handles.begin(), m_pReserved->m_handles.end(), allHandles.begin() );
+ ::std::copy( i_handles, i_handles + i_count, allHandles.begin() + additionalEvents );
+
+ ::std::vector< Any > allNewValues( additionalEvents + i_count );
+ ::std::copy( m_pReserved->m_newValues.begin(), m_pReserved->m_newValues.end(), allNewValues.begin() );
+ ::std::copy( i_newValues, i_newValues + i_count, allNewValues.begin() + additionalEvents );
+
+ ::std::vector< Any > allOldValues( additionalEvents + i_count );
+ ::std::copy( m_pReserved->m_oldValues.begin(), m_pReserved->m_oldValues.end(), allOldValues.begin() );
+ ::std::copy( i_oldValues, i_oldValues + i_count, allOldValues.begin() + additionalEvents );
+
+ m_pReserved->m_handles.clear();
+ m_pReserved->m_newValues.clear();
+ m_pReserved->m_oldValues.clear();
+
+ aGuard.clear();
+ fire( &allHandles[0], &allNewValues[0], &allOldValues[0], additionalEvents + i_count, sal_False );
+}
+
+//--------------------------------------------------------------------------
void OPropertySetHelper::fire
(
sal_Int32 * pnHandles,
@@ -803,7 +896,7 @@ void OPropertySetHelper::setFastPropertyValues(
}
// fire change events
- fire( pHandles, pConvertedValues, pOldValues, n, sal_False );
+ impl_fireAll( pHandles, pConvertedValues, pOldValues, n );
}
catch( ... )
{
diff --git a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
index b81db391966f..ae2719f1c07d 100644
--- a/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
+++ b/jurt/com/sun/star/lib/uno/bridges/java_remote/ProxyFactory.java
@@ -148,11 +148,22 @@ final class ProxyFactory {
private Object request(String operation, Object[] args) throws Throwable
{
- return requestHandler.sendRequest(oid, type, operation, args);
+ Object res = requestHandler.sendRequest(oid, type, operation, args);
+ // Avoid early finalization of this object, while an invoke ->
+ // request call is still ongoing; as finalize also calls request,
+ // this should fulfil the condition from The Java Language
+ // Specification, 3rd ed., that "if an object's finalizer can result
+ // in synchronization on that object, then that object must be alive
+ // and considered reachable whenever a lock is held on it:"
+ synchronized (this) {
+ ++dummy;
+ }
+ return res;
}
private final String oid;
private final Type type;
+ private int dummy = 0;
}
private static final Method METHOD_EQUALS;
diff --git a/jvmfwk/inc/jvmfwk/framework.h b/jvmfwk/inc/jvmfwk/framework.h
index 53914a3debed..7c3551f70116 100644
--- a/jvmfwk/inc/jvmfwk/framework.h
+++ b/jvmfwk/inc/jvmfwk/framework.h
@@ -830,6 +830,7 @@ javaFrameworkError SAL_CALL jfw_getJRELocations(
JFW_E_NONE the function ran successfully.</br>
JFW_E_ERROR an error occurred during execution.</br>
JFW_E_INVALID_ARG pInfo contains invalid data</br>
+ JFW_E_NO_PLUGIN a plug-in library could not be found.<br/>
*/
javaFrameworkError SAL_CALL jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
diff --git a/jvmfwk/inc/jvmfwk/vendorplugin.h b/jvmfwk/inc/jvmfwk/vendorplugin.h
index 258833490ab7..15707b1bbe88 100644
--- a/jvmfwk/inc/jvmfwk/vendorplugin.h
+++ b/jvmfwk/inc/jvmfwk/vendorplugin.h
@@ -238,6 +238,25 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
+/** checks if the installation of the jre still exists.
+
+ This function checks if the JRE described by pInfo still
+ exists. The check must be very quick because it is called by javaldx
+ (Linux, Solaris) at start up.
+
+ @param pInfo
+ [in] the JavaInfo object with information about the JRE.
+ @param pp_exist
+ [out] the parameter is set to either sal_True or sal_False. The value is
+ only valid if the function returns JFW_E_NONE.
+
+ @return
+ JFW_PLUGIN_E_NONE the function ran successfully.</br>
+ JFW_PLUGIN_E_ERROR an error occurred during execution.</br>
+ JFW_PLUGIN_E_INVALID_ARG pInfo contains invalid data</br>
+ */
+javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist);
+
#ifdef __cplusplus
}
#endif
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
index 6dd18ccc9f18..3ae1c0f16b92 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.cxx
@@ -73,7 +73,7 @@ char const* const* OtherInfo::getRuntimePaths(int * size)
"/bin/hotspot/jvm.dll"
#elif UNX
#ifdef MACOSX
- "/../../../JavaVM"
+ "/../../../../../Frameworks/JavaVM.framework/JavaVM" //as of 1.6.0_22
#else
"/lib/" JFW_PLUGIN_ARCH "/client/libjvm.so", // for Blackdown PPC
"/lib/" JFW_PLUGIN_ARCH "/server/libjvm.so", // for Blackdown AMD64
@@ -95,8 +95,7 @@ char const* const* OtherInfo::getLibraryPaths(int* size)
#ifdef UNX
static char const * ar[] = {
#ifdef MACOSX
- "/../Libraries",
- "/lib"
+ //mac version does not have a ld library path anymore
#else
"/bin",
"/jre/bin",
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 896342b5389d..b43edf53b3bc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -470,10 +470,10 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
{
JFW_ENSURE(0, OUSTR("[Java framework]sunjavaplugin" SAL_DLLEXTENSION
" could not load Java runtime library: \n")
- + sRuntimeLib + OUSTR("."));
+ + sRuntimeLib + OUSTR("\n"));
JFW_TRACE0(OUSTR("[Java framework]sunjavaplugin" SAL_DLLEXTENSION
" could not load Java runtime library: \n")
- + sRuntimeLib + OUSTR("."));
+ + sRuntimeLib + OUSTR("\n"));
return JFW_PLUGIN_E_VM_CREATION_FAILED;
}
@@ -614,5 +614,63 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
return errcode;
}
+extern "C"
+javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
+{
+ javaPluginError ret = JFW_PLUGIN_E_NONE;
+ if (!pInfo || !exist)
+ return JFW_PLUGIN_E_INVALID_ARG;
+ ::rtl::OUString sLocation(pInfo->sLocation);
+
+ if (sLocation.getLength() == 0)
+ return JFW_PLUGIN_E_INVALID_ARG;
+ ::osl::DirectoryItem item;
+ ::osl::File::RC rc_item = ::osl::DirectoryItem::get(sLocation, item);
+ if (::osl::File::E_None == rc_item)
+ {
+ *exist = sal_True;
+ }
+ else if (::osl::File::E_NOENT == rc_item)
+ {
+ *exist = sal_False;
+ }
+ else
+ {
+ ret = JFW_PLUGIN_E_ERROR;
+ }
+#ifdef MACOSX
+ //We can have the situation that the JavaVM runtime library is not
+ //contained within JAVA_HOME. Then the check for JAVA_HOME would return
+ //true although the runtime library may not be loadable.
+ if (ret == JFW_PLUGIN_E_NONE && *exist == sal_True)
+ {
+ rtl::OUString sRuntimeLib = getRuntimeLib(pInfo->arVendorData);
+ JFW_TRACE2(OUSTR("[Java framework] Checking existence of Java runtime library.\n"));
+
+ ::osl::DirectoryItem itemRt;
+ ::osl::File::RC rc_itemRt = ::osl::DirectoryItem::get(sRuntimeLib, itemRt);
+ if (::osl::File::E_None == rc_itemRt)
+ {
+ *exist = sal_True;
+ JFW_TRACE2(OUSTR("[Java framework] Java runtime library exist: ")
+ + sRuntimeLib + OUSTR("\n"));
+
+ }
+ else if (::osl::File::E_NOENT == rc_itemRt)
+ {
+ *exist = sal_False;
+ JFW_TRACE2(OUSTR("[Java framework] Java runtime library does not exist: ")
+ + sRuntimeLib + OUSTR("\n"));
+ }
+ else
+ {
+ ret = JFW_PLUGIN_E_ERROR;
+ JFW_TRACE2(OUSTR("[Java framework] Error while looking for Java runtime library: ")
+ + sRuntimeLib + OUSTR(" \n"));
+ }
+ }
+#endif
+ return ret;
+}
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map
index db75c9611076..901867f0a43d 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.map
@@ -6,3 +6,8 @@ UDK_3_0_0 {
local:
*;
};
+
+UDK_3.1 { # OOo 3.3
+ global:
+ jfw_plugin_existJRE;
+} UDK_3_0_0;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
index e17a6c788096..5d52046c705e 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx
@@ -418,9 +418,9 @@ SelfTest::SelfTest()
break;
}
if (bRet)
- JFW_TRACE2("[Java framework] sunjavaplugin: Testing class SunVersion succeeded.");
+ JFW_TRACE2("[Java framework] sunjavaplugin: Testing class SunVersion succeeded.\n");
else
- OSL_ENSURE(bRet, "[Java framework] sunjavaplugin: SunVersion self test failed");
+ OSL_ENSURE(bRet, "[Java framework] sunjavaplugin: SunVersion self test failed.\n");
}
#endif
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index bd49956c8baf..fc2a5b98215a 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -450,12 +450,12 @@ bool getJavaProps(const OUString & exePath,
rs = stdoutReader.readLine( & aLine);
if (rs != FileHandleReader::RESULT_OK)
break;
- JFW_TRACE2(OString("[Java framework] line:\" ")
- + aLine + OString(" \".\n"));
+// JFW_TRACE2(OString("[Java framework] line:\" ")
+// + aLine + OString(" \".\n"));
OUString sLine;
if (!decodeOutput(aLine, &sLine))
continue;
- JFW_TRACE2(OString("[Java framework] line:\" ")
+ JFW_TRACE2(OString("[Java framework]:\" ")
+ OString( CHAR_POINTER(sLine)) + OString(" \".\n"));
sLine = sLine.trim();
if (sLine.getLength() == 0)
@@ -509,7 +509,7 @@ bool decodeOutput(const rtl::OString& s, rtl::OUString* out)
} while (nIndex >= 0);
*out = buff.makeStringAndClear();
- JFW_TRACE2(*out);
+// JFW_TRACE2(*out);
return true;
}
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index c4e44f7ac375..9674c28d54df 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -930,6 +930,16 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
pDoc, cur->children, 1);
rtl::OUString sRequire = xmlRequire;
nRequirements = sRequire.toInt64(16);
+#ifdef MACOSX
+ //javaldx is not used anymore in the mac build. In case the Java
+ //corresponding to the saved settings does not exist anymore the
+ //javavm services will look for an existing Java after creation of
+ //the JVM failed. See stoc/source/javavm/javavm.cxx. Only if
+ //nRequirements does not have the flag JFW_REQUIRE_NEEDRESTART the
+ //jvm of the new selected JRE will be started. Old settings (before
+ //OOo 3.3) still contain the flag which can be safely ignored.
+ nRequirements &= ~JFW_REQUIRE_NEEDRESTART;
+#endif
}
else if (xmlStrcmp(cur->name, (xmlChar*) "vendorData") == 0)
{
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 1a2ac3b954ef..1194e73402dd 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -1114,29 +1114,39 @@ javaFrameworkError SAL_CALL jfw_getJRELocations(
javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
{
- javaFrameworkError ret = JFW_E_NONE;
- if (!pInfo || !exist)
- return JFW_E_INVALID_ARG;
- ::rtl::OUString sLocation(pInfo->sLocation);
-
- if (sLocation.getLength() == 0)
- return JFW_E_INVALID_ARG;
+ //get the function jfw_plugin_existJRE
+ jfw::VendorSettings aVendorSettings;
+ jfw::CJavaInfo aInfo;
+ aInfo = (const ::JavaInfo*) pInfo; //makes a copy of pInfo
+ rtl::OUString sLibPath = aVendorSettings.getPluginLibrary(aInfo.getVendor());
+ osl::Module modulePlugin(sLibPath);
+ if ( ! modulePlugin)
+ return JFW_E_NO_PLUGIN;
+ rtl::OUString sFunctionName(
+ RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_existJRE"));
+ jfw_plugin_existJRE_ptr pFunc =
+ (jfw_plugin_existJRE_ptr)
+ osl_getFunctionSymbol(modulePlugin, sFunctionName.pData);
+ if (pFunc == NULL)
+ return JFW_E_ERROR;
+
+ javaPluginError plerr = (*pFunc)(pInfo, exist);
- ::osl::DirectoryItem item;
- ::osl::File::RC rc_item = ::osl::DirectoryItem::get(sLocation, item);
- if (::osl::File::E_None == rc_item)
- {
- *exist = sal_True;
- }
- else if (::osl::File::E_NOENT == rc_item)
- {
- *exist = sal_False;
- }
- else
+ javaFrameworkError ret = JFW_E_NONE;
+ switch (plerr)
{
+ case JFW_PLUGIN_E_NONE:
+ ret = JFW_E_NONE;
+ break;
+ case JFW_PLUGIN_E_INVALID_ARG:
+ ret = JFW_E_INVALID_ARG;
+ break;
+ case JFW_PLUGIN_E_ERROR:
+ ret = JFW_E_ERROR;
+ break;
+ default:
ret = JFW_E_ERROR;
}
-
return ret;
}
diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index 57e6a262bcd3..163d12e85938 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -64,6 +64,10 @@ typedef javaPluginError (*jfw_plugin_startJavaVirtualMachine_ptr)(
JavaVM ** ppVM,
JNIEnv ** ppEnv);
+typedef javaPluginError (*jfw_plugin_existJRE_ptr)(
+ const JavaInfo *info,
+ sal_Bool *exist);
+
namespace jfw
{
diff --git a/offapi/com/sun/star/awt/XDialog2.idl b/offapi/com/sun/star/awt/XDialog2.idl
index cd42d792cd0a..fbc5313aeb47 100644
--- a/offapi/com/sun/star/awt/XDialog2.idl
+++ b/offapi/com/sun/star/awt/XDialog2.idl
@@ -25,7 +25,7 @@ interface XDialog2: com::sun::star::awt::XDialog
/** sets the help id so that the standard help button action will
show the appropriate help page.
*/
- void setHelpId ( [in] long Id );
+ void setHelpId ( [in] string Id );
};
//=============================================================================
diff --git a/offapi/com/sun/star/formula/FormulaProperties.idl b/offapi/com/sun/star/formula/FormulaProperties.idl
index d6f0f6bfeb28..4e03ff36c3a5 100644
--- a/offapi/com/sun/star/formula/FormulaProperties.idl
+++ b/offapi/com/sun/star/formula/FormulaProperties.idl
@@ -338,6 +338,14 @@ published service FormulaProperties
/** contains the metric value of the right margin of the formula.
*/
[property] short RightMargin;
+
+ //-------------------------------------------------------------------------
+
+ /** contains the baselines offset in respect to the top of the formula rectangle
+
+ @since OOo 3.4
+ */
+ [property, optional] short BaseLine;
};
//=============================================================================
diff --git a/offapi/com/sun/star/inspection/LineDescriptor.idl b/offapi/com/sun/star/inspection/LineDescriptor.idl
index 5bf9486f82ee..df8d72c9edd2 100644
--- a/offapi/com/sun/star/inspection/LineDescriptor.idl
+++ b/offapi/com/sun/star/inspection/LineDescriptor.idl
@@ -94,7 +94,7 @@ struct LineDescriptor
<p>If a primary button exists for a property's UI representation (<member>HasPrimaryButton</member>),
it gets the ID specified herein.</p>
*/
- long PrimaryButtonId;
+ string PrimaryButtonId;
/** describes the URL of an image to display on the primary button, if any.
@@ -139,7 +139,7 @@ struct LineDescriptor
@see PrimaryButtonId
*/
- long SecondaryButtonId;
+ string SecondaryButtonId;
/** describes the URL of an image to display on the secondary button, if any.
diff --git a/offapi/com/sun/star/text/DocumentSettings.idl b/offapi/com/sun/star/text/DocumentSettings.idl
index 3ab98fdd2ddc..19c4d75997cb 100644
--- a/offapi/com/sun/star/text/DocumentSettings.idl
+++ b/offapi/com/sun/star/text/DocumentSettings.idl
@@ -195,10 +195,20 @@ published service DocumentSettings
*/
[optional, property] boolean ConsiderTextWrapOnObjPos;
+ // ------------------------------------------------------------
+ /** specifies if Math objects should automatically vertically aligned to
+ match the baseline of the surrounding text.
+
+ <p>If activated formula object that are anchored 'As Character' will be
+ vertically aligned to have their baseline match with the one from the text.</p>
+
+ @since OOo 3.4
+ */
+ [optional, property] boolean MathBaselineAlignment;
};
//=============================================================================
}; }; }; };
-#endif
+#endif \ No newline at end of file
diff --git a/offapi/com/sun/star/text/TextFrame.idl b/offapi/com/sun/star/text/TextFrame.idl
index e43b3d79197c..e43b3d79197c 100755..100644
--- a/offapi/com/sun/star/text/TextFrame.idl
+++ b/offapi/com/sun/star/text/TextFrame.idl
diff --git a/offapi/com/sun/star/text/TextMarkupType.idl b/offapi/com/sun/star/text/TextMarkupType.idl
index 5137d47d217f..f5ea4e59f1ec 100644
--- a/offapi/com/sun/star/text/TextMarkupType.idl
+++ b/offapi/com/sun/star/text/TextMarkupType.idl
@@ -44,27 +44,32 @@ module com { module sun { module star { module text {
constants TextMarkupType
{
- /// Markup originates from spell checking.
+ /** Markup originates from spell checking.
+ */
const long SPELLCHECK = 1;
- /// Markup originates from proofreading
- /// @since OOo 3.0.1
+ /** Markup originates from proofreading
+ @since OOo 3.0.1
+ */
const long PROOFREADING = 2;
- /// Markup originates from smart tag checking.
+ /** Markup originates from smart tag checking.
+ */
const long SMARTTAG = 3;
- /// Markup originates from proofreading
- /// An inivisible markup used to identify sentence boundaries.
- /// @since OOo 3.0.1
+ /** Markup originates from proofreading
+ An inivisible markup type used in proofreading API calls.
+ @since OOo 3.0.1
+ */
const long SENTENCE = 4;
- /// Markups originates from change tracking.
- /// @since OOo 3.3
+ /** Markups originates from change tracking.
+ @since OOo 3.3
+ */
const long TRACK_CHANGE_INSERTION = 5;
const long TRACK_CHANGE_DELETION = 6;
const long TRACK_CHANGE_FORMATCHANGE = 7;
};
}; }; }; };
-#endif
+#endif \ No newline at end of file
diff --git a/offapi/com/sun/star/ui/UIElementType.idl b/offapi/com/sun/star/ui/UIElementType.idl
index f87d91ca6243..0b4301f54f2a 100644
--- a/offapi/com/sun/star/ui/UIElementType.idl
+++ b/offapi/com/sun/star/ui/UIElementType.idl
@@ -2,10 +2,13 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
+ * $RCSfile: UIElementType.idl,v $
+ * $Revision: 1.4 $
+ *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -78,6 +81,11 @@ constants UIElementType
const short TOOLPANEL = 7;
//-------------------------------------------------------------------------
+ /** specifies a window that can be docked.
+ */
+ const short DOCKINGWINDOW = 7;
+
+ //-------------------------------------------------------------------------
/** specifies the number of constants.
*/
const short COUNT = 8;
diff --git a/sal/inc/osl/diagnose.h b/sal/inc/osl/diagnose.h
index 055a7971e7b6..033b24c84360 100644
--- a/sal/inc/osl/diagnose.h
+++ b/sal/inc/osl/diagnose.h
@@ -78,15 +78,7 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf
#define OSL_THIS_FILE __FILE__
/* the macro OSL_THIS_FUNC is intended to be an office internal macro for now */
-#ifdef __func__
-#define OSL_THIS_FUNC __func__
-#elifdef __PRETTY_FUNCTION__
-#define OSL_THIS_FUNC __PRETTY_FUNCTION__
-#elifdef __FUNCTION__
-#define OSL_THIS_FUNC __FUNCTION__
-#else
-#define OSL_THIS_FUNC " "
-#endif
+#define OSL_THIS_FUNC "<unknown>"
/* the macro OSL_TO_STRING is intended to be an office internal macro for now */
#define OSL_TO_STRING( x ) #x
diff --git a/sal/inc/rtl/math.h b/sal/inc/rtl/math.h
index 985ce700b049..fa81108df29f 100644
--- a/sal/inc/rtl/math.h
+++ b/sal/inc/rtl/math.h
@@ -319,7 +319,9 @@ void SAL_CALL rtl_math_doubleToUString(rtl_uString ** pResult,
@param pParsedEnd
If non-null, returns one past the position of the last character parsed
away. Thus if [pBegin..pEnd) only contains the numerical string to be
- parsed, *pParsedEnd == pEnd on return.
+ parsed, *pParsedEnd == pEnd on return. If no numerical (sub-)string is
+ found, *pParsedEnd == pBegin on return, even if there was leading
+ whitespace.
*/
double SAL_CALL rtl_math_stringToDouble(
sal_Char const * pBegin, sal_Char const * pEnd, sal_Char cDecSeparator,
@@ -357,7 +359,9 @@ double SAL_CALL rtl_math_stringToDouble(
@param pParsedEnd
If non-null, returns one past the position of the last character parsed
away. Thus if [pBegin..pEnd) only contains the numerical string to be
- parsed, *pParsedEnd == pEnd on return.
+ parsed, *pParsedEnd == pEnd on return. If no numerical (sub-)string is
+ found, *pParsedEnd == pBegin on return, even if there was leading
+ whitespace.
*/
double SAL_CALL rtl_math_uStringToDouble(
sal_Unicode const * pBegin, sal_Unicode const * pEnd,
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 331b91cb1626..452d3eb2db70 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -1022,66 +1022,31 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD
return nRet;
}
- /* HACK: because memory mapping fails on various
- platforms if the size of the source file is 0 byte */
- if (0 == nSourceSize)
- {
- close(SourceFileFD);
- close(DestFileFD);
- return 0;
- }
-
- // read and lseek are used to check the possibility to access the data
- // not a nice solution, but it allows to avoid a crash in case it is an opened samba file
- // generally, reading of one byte should not affect the performance
- char nCh;
- if ( 1 != read( SourceFileFD, &nCh, 1 )
- || -1 == lseek( SourceFileFD, 0, SEEK_SET ) )
- {
- nRet = errno;
- close( SourceFileFD );
- close( DestFileFD );
- return nRet;
- }
-
size_t nWritten = 0;
size_t nRemains = nSourceSize;
- /* mmap file -- open dest file -- write -- fsync it at the end */
- void* pSourceFile = mmap( 0, nSourceSize, PROT_READ, MAP_SHARED, SourceFileFD, 0 );
- if ( pSourceFile != MAP_FAILED )
- {
- nWritten = write( DestFileFD, pSourceFile, nSourceSize );
- nRemains -= nWritten;
- munmap( (char*)pSourceFile, nSourceSize );
- }
-
if ( nRemains )
{
/* mmap has problems, try the direct streaming */
- char pBuffer[32000];
+ char pBuffer[0x8000];
size_t nRead = 0;
nRemains = nSourceSize;
- if ( -1 != lseek( SourceFileFD, 0, SEEK_SET )
- && -1 != lseek( DestFileFD, 0, SEEK_SET ) )
+ do
{
- do
- {
- nRead = 0;
- nWritten = 0;
+ nRead = 0;
+ nWritten = 0;
- size_t nToRead = std::min( (size_t)32000, nRemains );
- nRead = read( SourceFileFD, pBuffer, nToRead );
- if ( (size_t)-1 != nRead )
- nWritten = write( DestFileFD, pBuffer, nRead );
+ size_t nToRead = std::min( (size_t)0x8000, nRemains );
+ nRead = read( SourceFileFD, pBuffer, nToRead );
+ if ( (size_t)-1 != nRead )
+ nWritten = write( DestFileFD, pBuffer, nRead );
- if ( (size_t)-1 != nWritten )
- nRemains -= nWritten;
- }
- while( nRemains && (size_t)-1 != nRead && nRead == nWritten );
+ if ( (size_t)-1 != nWritten )
+ nRemains -= nWritten;
}
+ while( nRemains && (size_t)-1 != nRead && nRead == nWritten );
}
if ( nRemains )
diff --git a/sal/prj/build.lst b/sal/prj/build.lst
index c96c3977f725..06e3958443e9 100644
--- a/sal/prj/build.lst
+++ b/sal/prj/build.lst
@@ -20,3 +20,4 @@ sa sal\qa\OStringBuffer nmake - all sa_qa_OStringBuffer sa_cppunittester sa_util
sa sal\qa\osl\mutex nmake - all sa_qa_osl_mutex sa_cppunittester sa_util NULL
sa sal\qa\osl\pipe nmake - all sa_qa_osl_pipe sa_cppunittester sa_util NULL
sa sal\qa\osl\profile nmake - all sa_qa_osl_profile sa_cppunittester sa_util NULL
+sa sal\qa\rtl\math nmake - all sa_qa_rtl_math sa_cppunittester sa_util NULL
diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk
index d46168dc4d0e..e0c1a81d66e3 100644
--- a/sal/qa/OStringBuffer/makefile.mk
+++ b/sal/qa/OStringBuffer/makefile.mk
@@ -33,8 +33,6 @@ PRJ=..$/..
PRJNAME=sal
TARGET=qa_ostringbuffer
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/osl/process/makefile.mk b/sal/qa/osl/process/makefile.mk
index 6bbee03b6aaf..e113ac86edee 100644
--- a/sal/qa/osl/process/makefile.mk
+++ b/sal/qa/osl/process/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_osl_process
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/osl/profile/makefile.mk b/sal/qa/osl/profile/makefile.mk
index a95db211c2a6..67ad60057c07 100644
--- a/sal/qa/osl/profile/makefile.mk
+++ b/sal/qa/osl/profile/makefile.mk
@@ -33,7 +33,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_osl_profile
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/alloc/makefile.mk b/sal/qa/rtl/alloc/makefile.mk
index 37ae3718b40d..db4f01eb439b 100755
--- a/sal/qa/rtl/alloc/makefile.mk
+++ b/sal/qa/rtl/alloc/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_alloc
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/crc32/makefile.mk b/sal/qa/rtl/crc32/makefile.mk
index 6bd3bd89d5a6..704c149d45cd 100755
--- a/sal/qa/rtl/crc32/makefile.mk
+++ b/sal/qa/rtl/crc32/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_crc32
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/digest/makefile.mk b/sal/qa/rtl/digest/makefile.mk
index 415183b7e9a0..7798004ed854 100644
--- a/sal/qa/rtl/digest/makefile.mk
+++ b/sal/qa/rtl/digest/makefile.mk
@@ -29,8 +29,6 @@ INCPRE+= $(PRJ)$/qa$/inc
PRJNAME=sal
TARGET=rtl_digest
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/doublelock/makefile.mk b/sal/qa/rtl/doublelock/makefile.mk
index b13ccf420c06..45259fd3cba0 100644
--- a/sal/qa/rtl/doublelock/makefile.mk
+++ b/sal/qa/rtl/doublelock/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_doublelock
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/locale/makefile.mk b/sal/qa/rtl/locale/makefile.mk
index 329769b5d3ec..d6c9c6b674a3 100644
--- a/sal/qa/rtl/locale/makefile.mk
+++ b/sal/qa/rtl/locale/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_locale
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl/math/export.exp b/sal/qa/rtl/math/export.exp
deleted file mode 100644
index a13529da5876..000000000000
--- a/sal/qa/rtl/math/export.exp
+++ /dev/null
@@ -1 +0,0 @@
-registerAllTestFunction
diff --git a/sal/qa/rtl/math/makefile.mk b/sal/qa/rtl/math/makefile.mk
index 3b35e52ab1f4..59f2ecc495bb 100644
--- a/sal/qa/rtl/math/makefile.mk
+++ b/sal/qa/rtl/math/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -23,75 +23,33 @@
# <http://www.openoffice.org/license.html>
# for a copy of the LGPLv3 License.
#
-#*************************************************************************
-PRJ=..$/..$/..
-INCPRE+= $(PRJ)$/qa$/inc
+#***********************************************************************/
-PRJNAME=sal
-TARGET=rtl_math
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
-ENABLE_EXCEPTIONS=TRUE
+PRJ = ../../..
+PRJNAME = sal
+TARGET = qa_rtl_profile
-# --- Settings -----------------------------------------------------
+ENABLE_EXCEPTIONS = TRUE
-.INCLUDE : settings.mk
-
-CFLAGS+= $(LFS_CFLAGS)
-CXXFLAGS+= $(LFS_CFLAGS)
+.INCLUDE: settings.mk
CFLAGSCXX += $(CPPUNIT_CFLAGS)
-#----------------------------------- OStringBuffer -----------------------------------
-
-SHL1OBJS= \
- $(SLO)$/test_rtl_math.obj
-
-SHL1TARGET= rtl_math
-SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
-
-SHL1IMPLIB= i$(SHL1TARGET)
-# SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-
-DEF1NAME =$(SHL1TARGET)
-# DEF1EXPORTFILE= export.exp
-SHL1VERSIONMAP = $(PRJ)$/qa$/export.map
-
-# --- BEGIN --------------------------------------------------------
-SHL2OBJS= \
- $(SLO)$/rtl_math.obj
-SHL2TARGET= rtl_math2
-SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
-
-SHL2IMPLIB= i$(SHL2TARGET)
-DEF2NAME= $(SHL2TARGET)
-SHL2VERSIONMAP = $(PRJ)$/qa$/export.map
-
-
-
-# # --- BEGIN --------------------------------------------------------
-# LLA: this is an old test, which seems not to work
-# sal_setInt64()
-# sal_getInt64()
-# does not exist.
-#
-# SHL3OBJS= \
-# $(SLO)$/rtl_old_testint64.obj
-# SHL3TARGET= rtl_old_testint64
-# SHL3STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB)
-#
-# SHL3IMPLIB= i$(SHL3TARGET)
-# DEF3NAME= $(SHL3TARGET)
-# SHL3VERSIONMAP = $(PRJ)$/qa$/export.map
-#
-
-#------------------------------- All object files -------------------------------
-# do this here, so we get right dependencies
-# SLOFILES=$(SHL1OBJS)
+SHL1IMPLIB = i$(SHL1TARGET)
+SHL1OBJS = $(SLO)/test-rtl-math.obj
+SHL1RPATH = NONE
+SHL1STDLIBS = $(CPPUNITLIB) $(SALLIB)
+SHL1TARGET = test-rtl-math
+SHL1VERSIONMAP = $(PRJ)/qa/export.map
+DEF1NAME = $(SHL1TARGET)
-# --- Targets ------------------------------------------------------
+SLOFILES = $(SHL1OBJS)
-.INCLUDE : target.mk
-.INCLUDE : _cppunit.mk
+.INCLUDE: target.mk
+.INCLUDE: _cppunit.mk
+.END
diff --git a/sal/qa/rtl/math/rtl_math.cxx b/sal/qa/rtl/math/rtl_math.cxx
deleted file mode 100644
index 653106ce0e30..000000000000
--- a/sal/qa/rtl/math/rtl_math.cxx
+++ /dev/null
@@ -1,626 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sal.hxx"
-#ifdef WIN32
-// LLA: take a look into Microsofts math.h implementation, why this define is need
-#define _USE_MATH_DEFINES
-#endif
-
-#include <math.h>
-#include <testshl/simpleheader.hxx>
-#include <rtl/math.h>
-#include <rtl/string.hxx>
-
-#include "valueequal.hxx"
-
-namespace rtl_math
-{
-
-class test : public CppUnit::TestFixture
-{
-public:
- // initialise your test code values here.
- void setUp()
- {
- }
-
- void tearDown()
- {
- }
-
-
- void equalCheck(double _nResult, double _nExpect) /* throws Exception */
- {
- bool bEqualResult = is_double_equal(_nResult, _nExpect);
-
- rtl::OString sError = "rtl_math_round expected result is wrong should:(";
- sError += rtl::OString::valueOf(_nExpect);
- sError += ") but is:(";
- sError += rtl::OString::valueOf(_nResult);
- sError += ")";
-
- CPPUNIT_ASSERT_MESSAGE(sError.getStr(), bEqualResult == true);
- }
-
- // insert your test code here.
- void round_000()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nValue = M_PI;
- double nResult = 0.0;
-
- nResult = rtl_math_round(nValue, 0, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.0));
-
- nResult = rtl_math_round(nValue, 2, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.14));
-
- nResult = rtl_math_round(nValue, 3, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.142));
-
- nResult = rtl_math_round(nValue, 10, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(3.1415926536));
- }
-
- // insert your test code here.
- void round_001_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(0.2));
- }
-
- void round_001_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Corrected);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_002_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(0.1));
- }
-
- void round_002_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Down);
- equalCheck(nResult, double(-0.1));
- }
-// -----------------------------------------------------------------------------
- void round_003_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(0.2));
- }
-
- void round_003_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Up);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_004_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(0.1));
- }
-
- void round_004_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Floor);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_005_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(0.2));
- }
-
- void round_005_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_Ceiling);
- equalCheck(nResult, double(-0.1));
- }
-// -----------------------------------------------------------------------------
- void round_006_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(0.2));
- }
-
- void round_006_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_HalfDown);
- equalCheck(nResult, double(-0.2));
- }
-// -----------------------------------------------------------------------------
- void round_007_positiv()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(0.1, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.11, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.13, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.14, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.1499999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.1));
-
- nResult = rtl_math_round(0.15, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.151, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.16, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
-
- nResult = rtl_math_round(0.199999999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(0.2));
- }
-
- void round_007_negativ()
- {
- // this is demonstration code
- // CPPUNIT_ASSERT_MESSAGE("a message", 1 == 1);
-
- double nResult = 0.0;
-
- nResult = rtl_math_round(-0.1, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.11, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.13, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.14, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.1499999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.1));
-
- nResult = rtl_math_round(-0.15, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.151, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.16, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
-
- nResult = rtl_math_round(-0.19999999999, 1, rtl_math_RoundingMode_HalfUp);
- equalCheck(nResult, double(-0.2));
- }
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
- // because these macros are need by auto register mechanism.
-
- CPPUNIT_TEST_SUITE(test);
- CPPUNIT_TEST(round_000);
-
- CPPUNIT_TEST(round_001_positiv);
- CPPUNIT_TEST(round_001_negativ);
-
- CPPUNIT_TEST(round_002_positiv);
- CPPUNIT_TEST(round_002_negativ);
-
- CPPUNIT_TEST(round_003_positiv);
- CPPUNIT_TEST(round_003_negativ);
-
- CPPUNIT_TEST(round_004_positiv);
- CPPUNIT_TEST(round_004_negativ);
-
- CPPUNIT_TEST(round_005_positiv);
- CPPUNIT_TEST(round_005_negativ);
-
- CPPUNIT_TEST(round_006_positiv);
- CPPUNIT_TEST(round_006_negativ);
-
- CPPUNIT_TEST(round_007_positiv);
- CPPUNIT_TEST(round_007_negativ);
-
- CPPUNIT_TEST_SUITE_END();
-}; // class test
-
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_math::test, "rtl_math");
-} // namespace rtl_math
-
-
-// -----------------------------------------------------------------------------
-
-// this macro creates an empty function, which will called by the RegisterAllFunctions()
-// to let the user the possibility to also register some functions by hand.
-NOADDITIONAL;
-
diff --git a/sal/qa/rtl/math/rtl_old_testint64.cxx b/sal/qa/rtl/math/rtl_old_testint64.cxx
deleted file mode 100644
index e1f30ac03be6..000000000000
--- a/sal/qa/rtl/math/rtl_old_testint64.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sal.hxx"
-
-// LLA:
-// this file is converted to use with testshl2
-// original was placed in sal/test/textenc.cxx
-
-// fndef _OSL_DIAGNOSE_H_
-// nclude <osl/diagnose.h>
-// #endif
-
-#include <sal/types.h>
-
-#define TEST_ENSURE(c, m) CPPUNIT_ASSERT_MESSAGE((m), (c))
-
-// #if OSL_DEBUG_LEVEL > 0
-// #define TEST_ENSURE(c, m) OSL_ENSURE(c, m)
-// #else
-// #define TEST_ENSURE(c, m) OSL_VERIFY(c)
-// #endif
-
-#include <testshl/simpleheader.hxx>
-
-// -----------------------------------------------------------------------------
-namespace rtl_math
-{
- class int64 : public CppUnit::TestFixture
- {
- public:
- void test_int64();
-
- CPPUNIT_TEST_SUITE( int64 );
- CPPUNIT_TEST( test_int64 );
- CPPUNIT_TEST_SUITE_END( );
- };
-
-void int64::test_int64()
-{
-#ifndef SAL_INT64_IS_STRUCT
-#ifdef UNX
- sal_Int64 i1 = -3223372036854775807LL;
- sal_uInt64 u1 = 5223372036854775807ULL;
-#else
- sal_Int64 i1 = -3223372036854775807;
- sal_uInt64 u1 = 5223372036854775807;
-#endif
- sal_Int64 i2 = 0;
- sal_uInt64 u2 = 0;
-#else
- sal_Int64 i1;
- sal_setInt64(&i1, 3965190145L, -750499787L);
-
- sal_Int64 i2 = { 0, 0 };
-
- sal_uInt64 u1;
- sal_setUInt64(&u1, 1651507199UL, 1216161073UL);
-
- sal_uInt64 u2 = {0, 0 };
-
-#endif
- sal_uInt32 low = 0;
- sal_Int32 high = 0;
-
- sal_getInt64(i1, &low, &high);
- sal_setInt64(&i2, low, high);
-
- sal_uInt32 ulow = 0;
- sal_uInt32 uhigh = 0;
-
- sal_getUInt64(u1, &ulow, &uhigh);
- sal_setUInt64(&u2, ulow, uhigh);
-
-#ifndef SAL_INT64_IS_STRUCT
- TEST_ENSURE( i1 == i2, "test_int64 error 1");
-
- TEST_ENSURE( u1 == u2, "test_int64 error 2");
-#else
- TEST_ENSURE( (i1.Part1 == i2.Part1) && (i1.Part2 == i2.Part2),
- "test_int64 error 1");
-
- TEST_ENSURE( (u1.Part1 == u2.Part1) && (u1.Part2 == u2.Part2),
- "test_int64 error 2");
-#endif
- return;
-}
-
-} // namespace rtl_math
-
-// -----------------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_math::int64, "rtl_math" );
-
-// -----------------------------------------------------------------------------
-NOADDITIONAL;
-
-
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
new file mode 100644
index 000000000000..8e9875444280
--- /dev/null
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+*
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2000, 2010 Oracle and/or its affiliates.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+*
+************************************************************************/
+
+#include "precompiled_sal.hxx"
+#include "sal/config.h"
+
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+#include "cppunit/plugin/TestPlugIn.h"
+#include "rtl/math.hxx"
+#include "rtl/ustring.h"
+#include "rtl/ustring.hxx"
+#include "sal/types.h"
+
+namespace {
+
+class Test: public CppUnit::TestFixture {
+public:
+ void test_stringToDouble_good() {
+ rtl_math_ConversionStatus status;
+ sal_Int32 end;
+ double res = rtl::math::stringToDouble(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +1.E01foo")),
+ sal_Unicode('.'), sal_Unicode(','), &status, &end);
+ CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(RTL_CONSTASCII_LENGTH(" +1.E01")), end);
+ CPPUNIT_ASSERT_EQUAL(10.0, res);
+ }
+
+ void test_stringToDouble_bad() {
+ rtl_math_ConversionStatus status;
+ sal_Int32 end;
+ double res = rtl::math::stringToDouble(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" +Efoo")),
+ sal_Unicode('.'), sal_Unicode(','), &status, &end);
+ CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), end);
+ CPPUNIT_ASSERT_EQUAL(0.0, res);
+ }
+
+ CPPUNIT_TEST_SUITE(Test);
+ CPPUNIT_TEST(test_stringToDouble_good);
+ CPPUNIT_TEST(test_stringToDouble_bad);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(Test);
+
+}
+
+CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sal/qa/rtl/math/test_rtl_math.cxx b/sal/qa/rtl/math/test_rtl_math.cxx
deleted file mode 100644
index 887e3ddd1214..000000000000
--- a/sal/qa/rtl/math/test_rtl_math.cxx
+++ /dev/null
@@ -1,674 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sal.hxx"
-
-#include "rtl/math.h"
-#include "rtl/math.hxx"
-#include "rtl/strbuf.hxx"
-#include "rtl/string.h"
-#include "rtl/string.hxx"
-#include "rtl/textenc.h"
-// #include "rtl/tres.h"
-#include <testshl/tresstatewrapper.hxx>
-#include "rtl/ustring.hxx"
-#include "sal/types.h"
-
-#include <stdlib.h>
-
-namespace {
-
-struct FloatTraits
-{
- typedef float Number;
-
- static inline char const * getPrefix() { return "float"; }
-};
-
-struct DoubleTraits
-{
- typedef double Number;
-
- static inline char const * getPrefix() { return "double"; }
-};
-
-struct StringTraits
-{
- typedef rtl::OString String;
-
- static inline char const * getPrefix() { return "OString"; }
-
- static inline rtl::OString createFromAscii(char const * pString)
- { return rtl::OString(pString); }
-
- static inline void appendBuffer(rtl::OStringBuffer & rBuffer,
- rtl::OString const & rString)
- { rBuffer.append(rString); }
-
- static inline rtl::OString doubleToString(double fValue,
- rtl_math_StringFormat eFormat,
- sal_Int32 nDecPlaces,
- sal_Char cDecSeparator,
- bool bEraseTrailingDecZeros)
- {
- return rtl::math::doubleToString(fValue, eFormat, nDecPlaces,
- cDecSeparator, bEraseTrailingDecZeros);
- }
-};
-
-struct UStringTraits
-{
- typedef rtl::OUString String;
-
- static inline char const * getPrefix() { return "OUString"; }
-
- static inline rtl::OUString createFromAscii(char const * pString)
- { return rtl::OUString::createFromAscii(pString); }
-
- static inline void appendBuffer(rtl::OStringBuffer & rBuffer,
- rtl::OUString const & rString)
- { rBuffer.append(rtl::OUStringToOString(rString, RTL_TEXTENCODING_UTF8)); }
-
- static inline rtl::OUString doubleToString(double fValue,
- rtl_math_StringFormat eFormat,
- sal_Int32 nDecPlaces,
- sal_Unicode cDecSeparator,
- bool bEraseTrailingDecZeros)
- {
- return rtl::math::doubleToUString(fValue, eFormat, nDecPlaces,
- cDecSeparator,
- bEraseTrailingDecZeros);
- }
-};
-
-struct TestNumberToString
-{
- double fValue;
- rtl_math_StringFormat eFormat;
- sal_Int32 nDecPlaces;
- char cDecSeparator;
- bool bEraseTrailingDecZeros;
- char const * pResult;
-};
-
-template< typename StringT, typename NumberT >
-bool testNumberToString(hTestResult pTestResult,
- TestNumberToString const & rTest)
-{
- typename NumberT::Number fValue = static_cast< typename NumberT::Number >(rTest.fValue);
- if (fValue != rTest.fValue)
- return true;
-
- // LLA: t_print("size: %d ", sizeof(fValue));
- typename StringT::String aResult1;
-
- aResult1 = StringT::doubleToString(fValue, rTest.eFormat, rTest.nDecPlaces,
- rTest.cDecSeparator,
- rTest.bEraseTrailingDecZeros);
-
- typename StringT::String aResult2(StringT::createFromAscii(rTest.pResult));
-
- // LLA: rtl::OStringBuffer aBuf;
- // LLA: StringT::appendBuffer(aBuf, aResult1);
- // LLA: t_print("aResult1: %s ", aBuf.getStr());
- // LLA:
- // LLA: rtl::OStringBuffer aBuf2;
- // LLA: StringT::appendBuffer(aBuf2, aResult2);
- // LLA: t_print("aResult2: %s\n", aBuf2.getStr());
-
- bool bSuccess = aResult1 == aResult2;
-
- rtl::OStringBuffer aBuffer;
- aBuffer.append(StringT::getPrefix());
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("/"));
- aBuffer.append(NumberT::getPrefix());
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" doubleToString("));
- aBuffer.append(fValue);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.eFormat));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.nDecPlaces);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.cDecSeparator);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.bEraseTrailingDecZeros));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("): "));
- StringT::appendBuffer(aBuffer, aResult1);
- if (!bSuccess)
- {
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" != "));
- StringT::appendBuffer(aBuffer, aResult2);
- }
- // call to the real test checker
- // pTestResult->pFuncs->state_(pTestResult, bSuccess, "test_rtl_math",
- // aBuffer.getStr(), false);
- c_rtl_tres_state(pTestResult, bSuccess, aBuffer.getStr(), "testNumberToString");
- return bSuccess;
-}
-
-template< typename StringT, typename NumberT >
-bool testNumberToString(hTestResult pTestResult,
- TestNumberToString const * pTests, size_t nCount)
-{
- bool bSuccess = true;
- for (size_t i = 0; i < nCount; ++i)
- bSuccess &= testNumberToString< StringT, NumberT >(pTestResult,
- pTests[i]);
- return bSuccess;
-}
-
-struct TestStringToNumberToString
-{
- char const * pValue;
- rtl_math_StringFormat eFormat;
- sal_Int32 nDecPlaces;
- char cDecSeparator;
- bool bEraseTrailingDecZeros;
- char const * pResult;
-};
-
-template< typename StringT >
-bool testStringToNumberToString(hTestResult pTestResult,
- TestStringToNumberToString const & rTest)
-{
- double d = rtl::math::stringToDouble(StringT::createFromAscii(rTest.pValue),
- rTest.cDecSeparator, 0, 0, 0);
- typename StringT::String aResult1(
- StringT::doubleToString(d, rTest.eFormat, rTest.nDecPlaces,
- rTest.cDecSeparator,
- rTest.bEraseTrailingDecZeros));
- typename StringT::String aResult2(StringT::createFromAscii(rTest.pResult));
- bool bSuccess = aResult1 == aResult2;
- rtl::OStringBuffer aBuffer;
- aBuffer.append(StringT::getPrefix());
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(
- " doubleToString(stringToDouble("));
- aBuffer.append(rTest.pValue);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.cDecSeparator);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("), "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.eFormat));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.nDecPlaces);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(rTest.cDecSeparator);
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(", "));
- aBuffer.append(static_cast< sal_Int32 >(rTest.bEraseTrailingDecZeros));
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM("): "));
- StringT::appendBuffer(aBuffer, aResult1);
- if (!bSuccess)
- {
- aBuffer.append(RTL_CONSTASCII_STRINGPARAM(" != "));
- StringT::appendBuffer(aBuffer, aResult2);
- }
- // call to the real test checker
- // pTestResult->pFuncs->state_(pTestResult, bSuccess, "test_rtl_math",
- // aBuffer.getStr(), false);
- c_rtl_tres_state(pTestResult, bSuccess, aBuffer.getStr(), "testStringToNumberToString");
-
- return bSuccess;
-}
-
-template< typename StringT >
-bool testStringToNumberToString(hTestResult pTestResult,
- TestStringToNumberToString const * pTests,
- size_t nCount)
-{
- bool bSuccess = true;
- for (size_t i = 0; i < nCount; ++i)
- bSuccess &= testStringToNumberToString< StringT >(pTestResult,
- pTests[i]);
- return bSuccess;
-}
-
-}
-
-extern "C" sal_Bool SAL_CALL test_rtl_math(hTestResult pTestResult)
-{
- bool bReturn = true;
-
- {
- static TestNumberToString const aTest[]
- = { // 1, 1+2^-1, ..., 1+2^-52
- // Too few decimal digits are printed, so that various different
- // double values lead to the same output:
- { 1, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { 1.5, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.5" },
- { 1.25, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.25" },
- { 1.125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.125" },
- { 1.0625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0625" },
- { 1.03125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.03125" },
- { 1.015625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.015625" },
- { 1.0078125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0078125" },
- { 1.00390625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00390625" },
- { 1.001953125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.001953125" },
- { 1.0009765625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0009765625" },
- { 1.00048828125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00048828125" },
- { 1.000244140625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.000244140625" },
- { 1.0001220703125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.0001220703125" },
- { 1.00006103515625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00006103515625" },
- { 1.000030517578125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00003051757813" },
- { 1.0000152587890625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00001525878906" },
- { 1.00000762939453125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000762939453" },
- { 1.000003814697265625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000381469727" },
- { 1.0000019073486328125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000190734863" },
- { 1.00000095367431640625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000095367432" },
- { 1.000000476837158203125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000047683716" },
- { 1.0000002384185791015625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000023841858" },
- { 1.00000011920928955078125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000011920929" },
- { 1.000000059604644775390625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000005960464" },
- { 1.0000000298023223876953125, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000002980232" },
- { 1.00000001490116119384765625, rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1.00000001490116" },
- { 1.000000007450580596923828125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000745058" },
- { 1.0000000037252902984619140625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000372529" },
- { 1.00000000186264514923095703125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000186265" },
- { 1.000000000931322574615478515625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000093132" },
- { 1.0000000004656612873077392578125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000046566" },
- { 1.00000000023283064365386962890625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000023283" },
- { 1.000000000116415321826934814453125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000011642" },
- { 1.0000000000582076609134674072265625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000005821" },
- { 1.00000000002910383045673370361328125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.0000000000291" },
- { 1.000000000014551915228366851806640625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000001455" },
- { 1.0000000000072759576141834259033203125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000728" },
- { 1.00000000000363797880709171295166015625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000364" },
- { 1.000000000001818989403545856475830078125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000182" },
- { 1.0000000000009094947017729282379150390625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000091" },
- { 1.00000000000045474735088646411895751953125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000045" },
- { 1.000000000000227373675443232059478759765625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000023" },
- { 1.0000000000001136868377216160297393798828125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000011" },
- { 1.00000000000005684341886080801486968994140625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000006" },
- { 1.000000000000028421709430404007434844970703125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000003" },
- { 1.0000000000000142108547152020037174224853515625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000001" },
- { 1.00000000000000710542735760100185871124267578125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1.00000000000001" },
- { 1.000000000000003552713678800500929355621337890625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.0000000000000017763568394002504646778106689453125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.00000000000000088817841970012523233890533447265625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.000000000000000444089209850062616169452667236328125,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
- { 1.0000000000000002220446049250313080847263336181640625,
- rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max,
- '.', true, "1" },
-
- // 1, 1+2^-1, ..., 1+2^-52
- // Too few decimal digits are printed, so that various different
- // double values lead to the same output:
- { 1, rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.5, rtl_math_StringFormat_F, 53, '.', false,
- "1.50000000000000000000000000000000000000000000000000000" },
- { 1.25, rtl_math_StringFormat_F, 53, '.', false,
- "1.25000000000000000000000000000000000000000000000000000" },
- { 1.125, rtl_math_StringFormat_F, 53, '.', false,
- "1.12500000000000000000000000000000000000000000000000000" },
- { 1.0625, rtl_math_StringFormat_F, 53, '.', false,
- "1.06250000000000000000000000000000000000000000000000000" },
- { 1.03125, rtl_math_StringFormat_F, 53, '.', false,
- "1.03125000000000000000000000000000000000000000000000000" },
- { 1.015625, rtl_math_StringFormat_F, 53, '.', false,
- "1.01562500000000000000000000000000000000000000000000000" },
- { 1.0078125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00781250000000000000000000000000000000000000000000000" },
- { 1.00390625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00390625000000000000000000000000000000000000000000000" },
- { 1.001953125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00195312500000000000000000000000000000000000000000000" },
- { 1.0009765625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00097656250000000000000000000000000000000000000000000" },
- { 1.00048828125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00048828125000000000000000000000000000000000000000000" },
- { 1.000244140625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00024414062500000000000000000000000000000000000000000" },
- { 1.0001220703125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00012207031250000000000000000000000000000000000000000" },
- { 1.00006103515625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00006103515625000000000000000000000000000000000000000" },
- { 1.000030517578125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00003051757813000000000000000000000000000000000000000" },
- { 1.0000152587890625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00001525878906000000000000000000000000000000000000000" },
- { 1.00000762939453125, rtl_math_StringFormat_F, 53, '.', false,
- "1.00000762939453000000000000000000000000000000000000000" },
- { 1.000003814697265625, rtl_math_StringFormat_F, 53, '.', false,
- "1.00000381469727000000000000000000000000000000000000000" },
- { 1.0000019073486328125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000190734863000000000000000000000000000000000000000" },
- { 1.00000095367431640625, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000095367432000000000000000000000000000000000000000" },
- { 1.000000476837158203125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000047683716000000000000000000000000000000000000000" },
- { 1.0000002384185791015625, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000023841858000000000000000000000000000000000000000" },
- { 1.00000011920928955078125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000011920929000000000000000000000000000000000000000" },
- { 1.000000059604644775390625, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000005960464000000000000000000000000000000000000000" },
- { 1.0000000298023223876953125, rtl_math_StringFormat_F, 53, '.',
- false,
- "1.00000002980232000000000000000000000000000000000000000" },
- { 1.00000001490116119384765625, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000001490116000000000000000000000000000000000000000" },
- { 1.000000007450580596923828125, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000745058000000000000000000000000000000000000000" },
- { 1.0000000037252902984619140625, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000372529000000000000000000000000000000000000000" },
- { 1.00000000186264514923095703125, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000186265000000000000000000000000000000000000000" },
- { 1.000000000931322574615478515625, rtl_math_StringFormat_F, 53,
- '.', false,
- "1.00000000093132000000000000000000000000000000000000000" },
- { 1.0000000004656612873077392578125, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000046566000000000000000000000000000000000000000" },
- { 1.00000000023283064365386962890625, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000023283000000000000000000000000000000000000000" },
- { 1.000000000116415321826934814453125, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000011642000000000000000000000000000000000000000" },
- { 1.0000000000582076609134674072265625, rtl_math_StringFormat_F,
- 53, '.', false,
- "1.00000000005821000000000000000000000000000000000000000" },
- { 1.00000000002910383045673370361328125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000002910000000000000000000000000000000000000000" },
- { 1.000000000014551915228366851806640625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000001455000000000000000000000000000000000000000" },
- { 1.0000000000072759576141834259033203125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000728000000000000000000000000000000000000000" },
- { 1.00000000000363797880709171295166015625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000364000000000000000000000000000000000000000" },
- { 1.000000000001818989403545856475830078125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000182000000000000000000000000000000000000000" },
- { 1.0000000000009094947017729282379150390625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000091000000000000000000000000000000000000000" },
- { 1.00000000000045474735088646411895751953125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000045000000000000000000000000000000000000000" },
- { 1.000000000000227373675443232059478759765625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000023000000000000000000000000000000000000000" },
- { 1.0000000000001136868377216160297393798828125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000011000000000000000000000000000000000000000" },
- { 1.00000000000005684341886080801486968994140625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000006000000000000000000000000000000000000000" },
- { 1.000000000000028421709430404007434844970703125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000003000000000000000000000000000000000000000" },
- { 1.0000000000000142108547152020037174224853515625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000001000000000000000000000000000000000000000" },
- { 1.00000000000000710542735760100185871124267578125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000001000000000000000000000000000000000000000" },
- { 1.000000000000003552713678800500929355621337890625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.0000000000000017763568394002504646778106689453125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.00000000000000088817841970012523233890533447265625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.000000000000000444089209850062616169452667236328125,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" },
- { 1.0000000000000002220446049250313080847263336181640625,
- rtl_math_StringFormat_F, 53, '.', false,
- "1.00000000000000000000000000000000000000000000000000000" } };
- size_t const nCount = sizeof aTest / sizeof aTest[0];
-
-//LLA: the float tests are wrong here, due to the fact that
-// we calculate with too less digits after the point
-
-// bReturn &= testNumberToString< StringTraits, FloatTraits >(
-// pTestResult, aTest, nCount);
- bReturn &= testNumberToString< StringTraits, DoubleTraits >(
- pTestResult, aTest, nCount);
-// bReturn &= testNumberToString< UStringTraits, FloatTraits >(
-// pTestResult, aTest, nCount);
- bReturn &= testNumberToString< UStringTraits, DoubleTraits >(
- pTestResult, aTest, nCount);
- }
-
- {
- static TestStringToNumberToString const aTest[]
- = { { "1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { " 1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { " 1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { "\t1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { "\t 1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
- { " \t1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "1" },
-
- { "-1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { " -1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { " -1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { "\t-1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { "\t -1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
- { " \t-1", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', true, "-1" },
-
- { "1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { " 1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { " 1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { "\t1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { "\t 1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
- { " \t1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#INF" },
-
- { "-1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { " -1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { " -1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { "\t-1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { "\t -1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
- { " \t-1.#INF", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#INF" },
-
- { "1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { " 1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { " 1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { "\t1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { "\t 1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
- { " \t1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "1.#NAN" },
-
- { "-1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { " -1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { " -1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { "\t-1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { "\t -1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
- { " \t-1.#NAN", rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', false, "-1.#NAN" },
-
- { "3.14E-2000", rtl_math_StringFormat_E, 4, '.', false,
- "0.0000E+000" },
- { "3.14E-200", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E-200" },
- { "3.14E-20", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E-020" },
- { "3.14E-2", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E-002" },
- { "3.14E2", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E+002" },
- { "3.14E20", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E+020" },
- { "3.14E200", rtl_math_StringFormat_E, 4, '.', false,
- "3.1400E+200" },
- { "3.14E2000", rtl_math_StringFormat_E, 4, '.', false,
- "1.#INF" },
- };
- size_t const nCount = sizeof aTest / sizeof aTest[0];
- bReturn &= testStringToNumberToString< StringTraits >(
- pTestResult, aTest, nCount);
- bReturn &= testStringToNumberToString< UStringTraits >(
- pTestResult, aTest, nCount);
- }
-
- return bReturn;
-}
-
-// -----------------------------------------------------------------------------
-extern "C" void /* sal_Bool */ SAL_CALL test_rtl_math2( hTestResult hRtlTestResult )
-{
- c_rtl_tres_state_start(hRtlTestResult, "rtl_math" );
-
- test_rtl_math( hRtlTestResult );
-
- c_rtl_tres_state_end(hRtlTestResult, "rtl_math" );
-}
-// -----------------------------------------------------------------------------
-void RegisterAdditionalFunctions(FktRegFuncPtr _pFunc)
-{
- if (_pFunc)
- {
- (_pFunc)(&test_rtl_math2, "");
- }
-}
diff --git a/sal/qa/rtl/random/makefile.mk b/sal/qa/rtl/random/makefile.mk
index cd57ec9bcc13..ef8616a90916 100644
--- a/sal/qa/rtl/random/makefile.mk
+++ b/sal/qa/rtl/random/makefile.mk
@@ -28,8 +28,6 @@ PRJ=..$/..$/..
PRJNAME=sal
TARGET=qa_rtl_random
-# this is removed at the moment because we need some enhancements
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/qa/rtl_strings/makefile.mk b/sal/qa/rtl_strings/makefile.mk
index 387f0675ace8..708a41a87887 100644
--- a/sal/qa/rtl_strings/makefile.mk
+++ b/sal/qa/rtl_strings/makefile.mk
@@ -28,7 +28,6 @@ PRJ=..$/..
PRJNAME=sal
TARGET=qa_rtl_strings
-# TESTDIR=TRUE
ENABLE_EXCEPTIONS=TRUE
diff --git a/sal/rtl/source/math.cxx b/sal/rtl/source/math.cxx
index d983c5726230..34b940a301c9 100644
--- a/sal/rtl/source/math.cxx
+++ b/sal/rtl/source/math.cxx
@@ -923,7 +923,7 @@ inline double stringToDouble(CharT const * pBegin, CharT const * pEnd,
if (pStatus != 0)
*pStatus = eStatus;
if (pParsedEnd != 0)
- *pParsedEnd = p;
+ *pParsedEnd = p == p0 ? pBegin : p;
return fVal;
}
diff --git a/sal/systools/win32/kill/kill.cxx b/sal/systools/win32/kill/kill.cxx
index dd7ae85a0af2..ec1379ccfa6b 100644
--- a/sal/systools/win32/kill/kill.cxx
+++ b/sal/systools/win32/kill/kill.cxx
@@ -272,7 +272,7 @@ static void ParseCommandArgs( LPDWORD lpProcesses, LPDWORD lpdwNumProcesses, int
{
for ( int n = 0; n < NumSupportedSignals; n++ )
{
- _tprintf( _T("%s "), SupportedSignals[n] );
+ _tprintf( _T("%s "), SupportedSignals[n].lpSignalName );
}
_tprintf( _T("\n") );
ExitProcess( 0 );
diff --git a/sal/textenc/convertiscii.tab b/sal/textenc/convertiscii.tab
index 60672b8c0188..96f5dc8582c5 100644
--- a/sal/textenc/convertiscii.tab
+++ b/sal/textenc/convertiscii.tab
@@ -108,5 +108,5 @@ static ImplTextEncodingData const aImplIsciiDevanagariTextEncodingData
1,
1,
NULL,
- NULL,
+ "x-iscii-de",
RTL_TEXTENCODING_INFO_ASCII };
diff --git a/sal/textenc/tencinfo.c b/sal/textenc/tencinfo.c
index 0c51a98206e5..30a2fef0da72 100644
--- a/sal/textenc/tencinfo.c
+++ b/sal/textenc/tencinfo.c
@@ -910,6 +910,9 @@ rtl_TextEncoding SAL_CALL rtl_getTextEncodingFromMimeCharset( const sal_Char* pM
{ "csptcp154", RTL_TEXTENCODING_PT154 },
{ "pt154", RTL_TEXTENCODING_PT154 },
{ "cp154", RTL_TEXTENCODING_PT154 },
+ { "xisciide", RTL_TEXTENCODING_ISCII_DEVANAGARI },
+ /* This is no official MIME character set name, but is in use by
+ various windows APIs. */
{ NULL, RTL_TEXTENCODING_DONTKNOW }
};
@@ -1072,6 +1075,7 @@ rtl_getTextEncodingFromWindowsCodePage(sal_uInt32 nCodePage)
case 51932: return RTL_TEXTENCODING_EUC_JP;
case 51936: return RTL_TEXTENCODING_EUC_CN;
case 51949: return RTL_TEXTENCODING_EUC_KR;
+ case 57002: return RTL_TEXTENCODING_ISCII_DEVANAGARI;
case 65000: return RTL_TEXTENCODING_UTF7;
case 65001: return RTL_TEXTENCODING_UTF8;
default: return RTL_TEXTENCODING_DONTKNOW;
@@ -1147,6 +1151,7 @@ rtl_getWindowsCodePageFromTextEncoding(rtl_TextEncoding nEncoding)
case RTL_TEXTENCODING_EUC_JP: return 51932;
case RTL_TEXTENCODING_EUC_CN: return 51936;
case RTL_TEXTENCODING_EUC_KR: return 51949;
+ case RTL_TEXTENCODING_ISCII_DEVANAGARI: return 57002;
case RTL_TEXTENCODING_UTF7: return 65000;
case RTL_TEXTENCODING_UTF8: return 65001;
default: return 0;