diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-02-27 09:05:53 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-02-27 09:05:53 +0000 |
commit | 928121f3fa1b97ae930c9d004315dbb5a63559f4 (patch) | |
tree | 9460685d2b6117ae01da83085a89836cd9b741a9 /cppu/test | |
parent | 94b14bd1b2335f478382aace9d321918e170df92 (diff) |
INTEGRATION: CWS ia64port01_DEV300 (1.19.64); FILE MERGED
2008/02/16 15:27:58 cmc 1.19.64.1: #i84999# add tests for struct returning rules in registers depending on size and other characteristics, e.g. x86_64 and ia64
Diffstat (limited to 'cppu/test')
-rw-r--r-- | cppu/test/test_di.cxx | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/cppu/test/test_di.cxx b/cppu/test/test_di.cxx index 9ad8d8b2eeb8..36c527c3b5cc 100644 --- a/cppu/test/test_di.cxx +++ b/cppu/test/test_di.cxx @@ -4,9 +4,9 @@ * * $RCSfile: test_di.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: rt $ $Date: 2006-10-27 12:16:06 $ + * last change: $Author: obo $ $Date: 2008-02-27 10:05:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,6 +42,7 @@ #include "precompiled_cppu.hxx" #include <stdio.h> +#include <string.h> #include <rtl/ustring.hxx> #include <osl/diagnose.h> #include <osl/time.h> @@ -237,6 +238,15 @@ public: test::TestData& rStruct ) throw(com::sun::star::uno::RuntimeException); + virtual test::SmallStruct echoSmallStruct(const test::SmallStruct& rStruct) throw(com::sun::star::uno::RuntimeException) + { return rStruct; } + virtual test::MediumStruct echoMediumStruct(const test::MediumStruct& rStruct) throw(com::sun::star::uno::RuntimeException) + { return rStruct; } + virtual test::BigStruct echoBigStruct(const test::BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException) + { return rStruct; } + virtual test::AllFloats echoAllFloats(const test::AllFloats& rStruct) throw(com::sun::star::uno::RuntimeException) + { return rStruct; } + virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException) { return _aData.Bool; } virtual sal_Int8 SAL_CALL getByte() throw(com::sun::star::uno::RuntimeException) @@ -493,7 +503,27 @@ static sal_Bool performTest( aRet.Sequence = xLBT->getSequence(); aRet2 = xLBT->getStruct(); - return (equals( aData, aRet ) && equals( aData, aRet2 )); + OSL_ASSERT( equals( aData, aRet ) && equals( aData, aRet2 ) ); + } + { + test::SmallStruct aIn(1, 2); + test::SmallStruct aOut = xLBT->echoSmallStruct(aIn); + OSL_ASSERT( memcmp(&aIn, &aOut, sizeof(test::SmallStruct)) == 0 ); + } + { + test::MediumStruct aIn(1, 2, 3, 4); + test::MediumStruct aOut = xLBT->echoMediumStruct(aIn); + OSL_ASSERT( memcmp(&aIn, &aOut, sizeof(test::MediumStruct)) == 0 ); + } + { + test::BigStruct aIn(1, 2, 3, 4, 5, 6, 7, 8); + test::BigStruct aOut = xLBT->echoBigStruct(aIn); + OSL_ASSERT( memcmp(&aIn, &aOut, sizeof(test::BigStruct)) == 0 ); + } + { + test::AllFloats aIn(1.1, 2.2, 3.3, 4.4); + test::AllFloats aOut = xLBT->echoAllFloats(aIn); + return( memcmp(&aIn, &aOut, sizeof(test::AllFloats)) == 0 ); } } return sal_False; |