summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorJörg Budischewski <jbu@openoffice.org>2000-12-08 10:07:33 +0000
committerJörg Budischewski <jbu@openoffice.org>2000-12-08 10:07:33 +0000
commit72647fcf7291a4925c730236ab0310bdec8dc2a5 (patch)
tree6f4a74e0197442edf0a1636553da7d3dea18c7d9 /io
parent31ad4bfdab5db9eaab19d6f7a1cedacb72a15801 (diff)
unicode change, damn, it did this already once before
Diffstat (limited to 'io')
-rw-r--r--io/test/makefile.mk12
-rw-r--r--io/test/stm/datatest.cxx74
-rw-r--r--io/test/stm/makefile.mk31
-rw-r--r--io/test/stm/marktest.cxx8
-rw-r--r--io/test/testcomponent.cxx12
-rw-r--r--io/test/testconnection.cxx46
6 files changed, 108 insertions, 75 deletions
diff --git a/io/test/makefile.mk b/io/test/makefile.mk
index ee5cf755a..263475b1f 100644
--- a/io/test/makefile.mk
+++ b/io/test/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.2 $
+# $Revision: 1.3 $
#
-# last change: $Author: jbu $ $Date: 2000-12-08 08:25:14 $
+# last change: $Author: jbu $ $Date: 2000-12-08 11:07:30 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -82,6 +82,14 @@ ENABLE_EXCEPTIONS=TRUE
OBJFILES= $(OBJ)$/testcomponent.obj \
$(OBJ)$/testconnection.obj
+UNOUCRDEP=$(SOLARBINDIR)$/udkapi.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/udkapi.rdb
+
+# output directory (one dir for each project)
+UNOUCROUT=$(OUT)$/inc
+
+UNOTYPES = com.sun.star.connection.XConnector \
+ com.sun.star.connection.XAcceptor
#
# std testcomponent
diff --git a/io/test/stm/datatest.cxx b/io/test/stm/datatest.cxx
index 3c3465dce..37e50fe1a 100644
--- a/io/test/stm/datatest.cxx
+++ b/io/test/stm/datatest.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: datatest.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jbu $ $Date: 2000-12-08 08:23:36 $
+ * last change: $Author: jbu $ $Date: 2000-12-08 11:07:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -153,7 +153,7 @@ void ODataStreamTest::testInvariant(
throw ( IllegalArgumentException,
RuntimeException)
{
- if( L"com.sun.star.io.DataInputStream" == TestName ) {
+ if( OUString::createFromAscii("com.sun.star.io.DataInputStream") == TestName ) {
Reference < XConnectable > connect( TestObject , UNO_QUERY );
Reference < XActiveDataSink > active( TestObject , UNO_QUERY );
Reference < XInputStream > input( TestObject , UNO_QUERY );
@@ -166,7 +166,7 @@ void ODataStreamTest::testInvariant(
}
- else if( L"com.sun.star.io.DataInputStream" == TestName ) {
+ else if( OUString::createFromAscii("com.sun.star.io.DataInputStream") == TestName ) {
Reference < XConnectable > connect( TestObject , UNO_QUERY );
Reference < XActiveDataSource > active( TestObject , UNO_QUERY );
Reference < XOutputStream > output( TestObject , UNO_QUERY );
@@ -184,7 +184,7 @@ void ODataStreamTest::testInvariant(
if( info.is() )
{
ERROR_ASSERT( info->supportsService( TestName ), "XServiceInfo test failed" );
- ERROR_ASSERT( ! info->supportsService( L"bla bluzb" ) , "XServiceInfo test failed" );
+ ERROR_ASSERT( ! info->supportsService( OUString::createFromAscii("bla bluzb") ) , "XServiceInfo test failed" );
}
}
@@ -197,8 +197,8 @@ sal_Int32 ODataStreamTest::test(
throw ( IllegalArgumentException,
RuntimeException)
{
- if( L"com.sun.star.io.DataInputStream" == TestName ||
- L"com.sun.star.io.DataOutputStream" == TestName ) {
+ if( OUString::createFromAscii("com.sun.star.io.DataInputStream") == TestName ||
+ OUString::createFromAscii("com.sun.star.io.DataOutputStream") == TestName ) {
try
{
@@ -323,11 +323,11 @@ void ODataStreamTest::testSimple( const Reference < XDataInputStream > &rInput,
rOutput->writeHyper( 0x123456789abcdef );
ERROR_ASSERT( rInput->readHyper() == 0x123456789abcdef , "int64 read/write mismatch" );
- rOutput->writeUTF( L"Live long and prosper !" );
- ERROR_ASSERT( rInput->readUTF() == L"Live long and prosper !" ,
+ rOutput->writeUTF( OUString::createFromAscii("Live long and prosper !") );
+ ERROR_ASSERT( rInput->readUTF() == OUString::createFromAscii("Live long and prosper !") ,
"UTF read/write mismatch" );
- Sequence<wchar_t> wc(0x10001);
+ Sequence<sal_Unicode> wc(0x10001);
for( int i = 0 ; i < 0x10000 ; i ++ ) {
wc.getArray()[i] = L'c';
}
@@ -488,7 +488,7 @@ public:
double m_d;
sal_Bool m_b;
sal_Int8 m_byte;
- wchar_t m_c;
+ sal_Unicode m_c;
OUString m_s;
Reference< XPersistObject > m_ref;
OUString m_sServiceName;
@@ -511,28 +511,28 @@ void MyPersistObject::setPropertyValue(
WrappedTargetException,
RuntimeException)
{
- if( L"long" == aPropertyName ) {
+ if( 0 == aPropertyName.compareToAscii("long") ) {
aValue >>= m_l;
}
- else if ( L"float" == aPropertyName ) {
+ else if ( 0 == aPropertyName.compareToAscii("float") ) {
aValue >>= m_f;
}
- else if( L"double" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("double") ) {
aValue >>= m_d;
}
- else if( L"bool" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("bool") ) {
aValue >>= m_b;
}
- else if( L"byte" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("byte" ) ) {
aValue >>= m_byte;
}
- else if( L"char" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("char") ) {
aValue >>= m_c;
}
- else if( L"string" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("string") ) {
aValue >>= m_s;
}
- else if( L"object" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("object") ) {
if( aValue.getValueType() == getCppuType( (Reference< XPersistObject> *)0 ) )
{
aValue >>= m_ref;
@@ -551,28 +551,28 @@ Any MyPersistObject::getPropertyValue(const OUString& aPropertyName)
RuntimeException)
{
Any aValue;
- if( L"long" == aPropertyName ) {
+ if( 0 == aPropertyName.compareToAscii("long" ) ) {
aValue <<= m_l;
}
- else if ( L"float" == aPropertyName ) {
+ else if ( 0 == aPropertyName.compareToAscii("float") ) {
aValue <<= m_f;
}
- else if( L"double" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("double") ) {
aValue <<= m_d;
}
- else if( L"bool" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("bool") ) {
aValue <<= m_b;
}
- else if( L"byte" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("byte") ) {
aValue <<= m_byte;
}
- else if( L"char" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("char" ) ) {
aValue <<= m_c;
}
- else if( L"string" == aPropertyName ) {
+ else if( 0 == aPropertyName.compareToAscii("string") ) {
aValue <<= m_s;
}
- else if( L"object" == aPropertyName )
+ else if( 0 == aPropertyName.compareToAscii("object" ) )
{
aValue <<= m_ref;
}
@@ -740,7 +740,7 @@ void OObjectStreamTest::testInvariant( const OUString& TestName,
if( info.is() )
{
ERROR_ASSERT( info->supportsService( TestName ), "XServiceInfo test failed" );
- ERROR_ASSERT( ! info->supportsService( L"bla bluzb" ) , "XServiceInfo test failed" );
+ ERROR_ASSERT( ! info->supportsService( OUString::createFromAscii("bla bluzb") ) , "XServiceInfo test failed" );
}
}
@@ -751,8 +751,8 @@ sal_Int32 OObjectStreamTest::test( const OUString& TestName,
throw ( IllegalArgumentException,
RuntimeException)
{
- if( L"com.sun.star.io.ObjectInputStream" == TestName ||
- L"com.sun.star.io.ObjectOutputStream" == TestName ) {
+ if( 0 == TestName.compareToAscii("com.sun.star.io.ObjectInputStream") ||
+ 0 == TestName.compareToAscii("com.sun.star.io.ObjectOutputStream" ) ) {
try
{
@@ -858,8 +858,8 @@ sal_Bool compareMyPropertySet( Reference< XPropertySet > &r1 , Reference < XProp
{
sal_Bool b = sal_True;
- if( r1->getPropertyValue( L"long" ).getValueType() == getCppuVoidType() ||
- r2->getPropertyValue( L"long" ).getValueType() == getCppuVoidType() ) {
+ if( r1->getPropertyValue( OUString::createFromAscii("long") ).getValueType() == getCppuVoidType() ||
+ r2->getPropertyValue( OUString::createFromAscii("long") ).getValueType() == getCppuVoidType() ) {
// one of the objects is not the correct propertyset !
return sal_False;
@@ -1011,8 +1011,8 @@ void OObjectStreamTest::testObject( const Reference< XObjectOutputStream > &r
ERROR_ASSERT( compareMyPropertySet( rProp , rPropRead ) , "objects has not been read properly !" );
// destroy selfreferences
- rProp->setPropertyValue( L"object", Any() );
- rPropRead->setPropertyValue( L"object", Any() );
+ rProp->setPropertyValue( OUString::createFromAscii("object"), Any() );
+ rPropRead->setPropertyValue( OUString::createFromAscii("object"), Any() );
}
{
@@ -1023,7 +1023,7 @@ void OObjectStreamTest::testObject( const Reference< XObjectOutputStream > &r
// buffering and marks work correctly
for( int i = 0 ; i < 2000 ; i ++ ) {
- Reference < XInterface > x = m_rFactory->createInstance(L"test.com.sun.star.io.PersistTest");
+ Reference < XInterface > x = m_rFactory->createInstance(OUString::createFromAscii("test.com.sun.star.io.PersistTest"));
Reference< XPersistObject > persistRef( x , UNO_QUERY );
Reference < XPropertySet > rProp( persistRef , UNO_QUERY );
@@ -1058,13 +1058,13 @@ void OObjectStreamTest::testObject( const Reference< XObjectOutputStream > &r
any <<= str;
rProp->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("string")) , any );
- x = m_rFactory->createInstance(L"test.com.sun.star.io.PersistTest");
+ x = m_rFactory->createInstance(OUString::createFromAscii("test.com.sun.star.io.PersistTest"));
Reference <XPersistObject > persist2ndRef( x , UNO_QUERY );
// Note : persist2ndRef contains coincident values, but also coincident values must be
// saved properly !
any <<= persist2ndRef;
- rProp->setPropertyValue( L"object" , any );
+ rProp->setPropertyValue( OUString::createFromAscii("object") , any );
// simply test, if markable operations and object operations do not interfere
sal_Int32 nMark = markableOut->createMark();
diff --git a/io/test/stm/makefile.mk b/io/test/stm/makefile.mk
index c4a8ffc56..8480e2581 100644
--- a/io/test/stm/makefile.mk
+++ b/io/test/stm/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.1.1.1 $
+# $Revision: 1.2 $
#
-# last change: $Author: hr $ $Date: 2000-09-18 17:24:19 $
+# last change: $Author: jbu $ $Date: 2000-12-08 11:07:33 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -71,14 +71,35 @@ ENABLE_EXCEPTIONS=TRUE
.INCLUDE : settings.mk
.INCLUDE : sv.mk
# --- Files --------------------------------------------------------
-UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
-UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRDEP=$(SOLARBINDIR)$/udkapi.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/udkapi.rdb
# output directory (one dir for each project)
UNOUCROUT=$(OUT)$/inc
UNOTYPES = com.sun.star.test.XSimpleTest \
- com.sun.star.beans.XPropertySet
+ com.sun.star.beans.XPropertySet \
+ com.sun.star.io.UnexpectedEOFException \
+ com.sun.star.io.WrongFormatException \
+ com.sun.star.io.XActiveDataControl \
+ com.sun.star.io.XActiveDataSink \
+ com.sun.star.io.XActiveDataSource \
+ com.sun.star.io.XConnectable \
+ com.sun.star.io.XMarkableStream \
+ com.sun.star.io.XObjectInputStream \
+ com.sun.star.io.XObjectOutputStream \
+ com.sun.star.lang.IllegalArgumentException \
+ com.sun.star.lang.XComponent \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.lang.XServiceInfo \
+ com.sun.star.lang.XSingleServiceFactory \
+ com.sun.star.lang.XTypeProvider \
+ com.sun.star.registry.XImplementationRegistration \
+ com.sun.star.registry.XRegistryKey \
+ com.sun.star.test.XSimpleTest \
+ com.sun.star.uno.TypeClass \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.uno.XWeak
SLOFILES= \
$(SLO)$/testfactreg.obj \
diff --git a/io/test/stm/marktest.cxx b/io/test/stm/marktest.cxx
index e182a2434..d9755777d 100644
--- a/io/test/stm/marktest.cxx
+++ b/io/test/stm/marktest.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: marktest.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:24:19 $
+ * last change: $Author: jbu $ $Date: 2000-12-08 11:07:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -178,7 +178,7 @@ sal_Int32 OMarkableOutputStreamTest::test(
}
else
{
- Reference < XInterface > x = m_rFactory->createInstance( L"com.sun.star.io.Pipe");
+ Reference < XInterface > x = m_rFactory->createInstance( OUString::createFromAscii("com.sun.star.io.Pipe"));
Reference< XOutputStream > rPipeOutput( x , UNO_QUERY );
Reference < XInputStream > rPipeInput( x , UNO_QUERY );
@@ -545,7 +545,7 @@ sal_Int32 OMarkableInputStreamTest::test(
testInvariant( TestName , TestObject );
}
else {
- Reference < XInterface > x = m_rFactory->createInstance( L"com.sun.star.io.Pipe");
+ Reference < XInterface > x = m_rFactory->createInstance( OUString::createFromAscii("com.sun.star.io.Pipe"));
Reference< XOutputStream > rPipeOutput( x , UNO_QUERY );
Reference < XInputStream > rPipeInput( x , UNO_QUERY );
diff --git a/io/test/testcomponent.cxx b/io/test/testcomponent.cxx
index b5fa7157b..7742acf2a 100644
--- a/io/test/testcomponent.cxx
+++ b/io/test/testcomponent.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: testcomponent.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:24:18 $
+ * last change: $Author: jbu $ $Date: 2000-12-08 11:07:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -134,9 +134,9 @@ int main (int argc, char **argv)
#ifdef SAL_W32
OUString aDllName = OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US );
#else
- OUString aDllName = L"lib";
+ OUString aDllName = OUString::createFromAscii("lib");
aDllName += OStringToOUString( argv[n] , RTL_TEXTENCODING_ASCII_US );
- aDllName += L".so";
+ aDllName += OUString::createFromAscii(".so");
#endif
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
@@ -161,9 +161,9 @@ int main (int argc, char **argv)
#ifdef SAL_W32
OUString aDllName = OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US );
#else
- OUString aDllName = L"lib";
+ OUString aDllName = OUString::createFromAscii("lib");
aDllName += OStringToOUString( sTestName , RTL_TEXTENCODING_ASCII_US );
- aDllName += L".so";
+ aDllName += OUString::createFromAscii(".so");
#endif
xReg->registerImplementation(
diff --git a/io/test/testconnection.cxx b/io/test/testconnection.cxx
index 17547c59e..bc0647cf9 100644
--- a/io/test/testconnection.cxx
+++ b/io/test/testconnection.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: testconnection.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jbu $ $Date: 2000-12-08 08:25:14 $
+ * last change: $Author: jbu $ $Date: 2000-12-08 11:07:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -209,13 +209,16 @@ void testConnection( const OUString &sConnectionDescription ,
#ifdef UNX
-#define REG_PREFIX L"lib"
-#define DLL_POSTFIX L".so"
+#define REG_PREFIX "lib"
+#define DLL_POSTFIX ".so"
#else
-#define REG_PREFIX L""
-#define DLL_POSTFIX L".dll"
+#define REG_PREFIX ""
+#define DLL_POSTFIX ".dll"
#endif
+#ifdef SOLARIS
+ extern "C" ChangeGlobalInit();
+#endif
#if (defined UNX) || (defined OS2)
int main( int argc, char * argv[] )
@@ -224,50 +227,51 @@ int __cdecl main( int argc, char * argv[] )
#endif
{
#ifdef SOLARIS
- extern "C" ChangeGlobalInit();
ChangeGlobalInit();
#endif
Reference< XMultiServiceFactory > xMgr(
createRegistryServiceFactory( OUString( RTL_CONSTASCII_USTRINGPARAM("applicat.rdb")) ) );
Reference< XImplementationRegistration > xImplReg(
- xMgr->createInstance( L"com.sun.star.registry.ImplementationRegistration" ), UNO_QUERY );
+ xMgr->createInstance( OUString::createFromAscii("com.sun.star.registry.ImplementationRegistration") ), UNO_QUERY );
OSL_ENSHURE( xImplReg.is(), "### no impl reg!" );
- OUString aLibName( REG_PREFIX );
- aLibName += L"connectr";
+ OUString aLibName = OUString::createFromAscii( REG_PREFIX );
+ aLibName += OUString::createFromAscii("connectr");
#ifndef OS2
- aLibName += DLL_POSTFIX;
+ aLibName += OUString::createFromAscii(DLL_POSTFIX);
#endif
xImplReg->registerImplementation(
- L"com.sun.star.loader.SharedLibrary", aLibName, Reference< XSimpleRegistry >() );
+ OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), aLibName, Reference< XSimpleRegistry >() );
- aLibName = OUString( REG_PREFIX );
- aLibName += L"acceptor";
+ aLibName = OUString::createFromAscii( REG_PREFIX );
+ aLibName += OUString::createFromAscii("acceptor");
#ifndef OS2
- aLibName += DLL_POSTFIX;
+ aLibName += OUString::createFromAscii(DLL_POSTFIX);
#endif
xImplReg->registerImplementation(
- L"com.sun.star.loader.SharedLibrary", aLibName, Reference< XSimpleRegistry >() );
+ OUString::createFromAscii("com.sun.star.loader.SharedLibrary"), aLibName, Reference< XSimpleRegistry >() );
Reference < XAcceptor > rAcceptor(
- xMgr->createInstance( L"com.sun.star.connection.Acceptor" ) , UNO_QUERY );
+ xMgr->createInstance(
+ OUString::createFromAscii("com.sun.star.connection.Acceptor" ) ) , UNO_QUERY );
Reference < XAcceptor > rAcceptorPipe(
- xMgr->createInstance( L"com.sun.star.connection.Acceptor" ) , UNO_QUERY );
+ xMgr->createInstance(
+ OUString::createFromAscii("com.sun.star.connection.Acceptor" ) ) , UNO_QUERY );
Reference < XConnector > rConnector(
- xMgr->createInstance( L"com.sun.star.connection.Connector" ) , UNO_QUERY );
+ xMgr->createInstance( OUString::createFromAscii("com.sun.star.connection.Connector") ) , UNO_QUERY );
printf( "Testing sockets" );
fflush( stdout );
- testConnection( L"socket,host=localhost,port=2001", rAcceptor , rConnector );
+ testConnection( OUString::createFromAscii("socket,host=localhost,port=2001"), rAcceptor , rConnector );
printf( " Done\n" );
printf( "Testing pipe" );
fflush( stdout );
- testConnection( L"pipe,name=bla" , rAcceptorPipe , rConnector );
+ testConnection( OUString::createFromAscii("pipe,name=bla") , rAcceptorPipe , rConnector );
printf( " Done\n" );