diff options
Diffstat (limited to 'connectivity/workben/testmoz/mozthread.cxx')
-rw-r--r-- | connectivity/workben/testmoz/mozthread.cxx | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/connectivity/workben/testmoz/mozthread.cxx b/connectivity/workben/testmoz/mozthread.cxx index c61e5d8a0e06..9286ec1695a6 100644 --- a/connectivity/workben/testmoz/mozthread.cxx +++ b/connectivity/workben/testmoz/mozthread.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -77,14 +78,12 @@ using namespace comphelper; using namespace cppu; -using namespace rtl; using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star::registry; using namespace com::sun::star::ucb; using namespace com::sun::star::beans; -//using namespace com::sun::star; using namespace connectivity; using namespace com::sun::star::sdb; using namespace com::sun::star::sdbc; @@ -92,6 +91,9 @@ using namespace com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace com::sun::star::registry; +using ::rtl::OUString; +using ::rtl::OUStringToOString; + extern Reference< XMultiServiceFactory > InitializeFac( void ); Reference< XMultiServiceFactory > mMgr; @@ -189,10 +191,10 @@ int TestMetaData(Reference< ::com::sun::star::sdbc::XConnection> &pConnection) OSL_TRACE("Testing getColumns() : START\n"); { Reference<XResultSet> xRes = xDmd->getColumns( - makeAny(OUString::createFromAscii("")), // Catalog - OUString::createFromAscii("%"), // Schema - OUString::createFromAscii("%"), // TabName - OUString::createFromAscii("%") + makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog + OUString(RTL_CONSTASCII_USTRINGPARAM("%")), // Schema + OUString(RTL_CONSTASCII_USTRINGPARAM("%")), // TabName + OUString(RTL_CONSTASCII_USTRINGPARAM("%")) ); printXResultSets( xRes ); } @@ -208,9 +210,9 @@ int TestMetaData(Reference< ::com::sun::star::sdbc::XConnection> &pConnection) OSL_TRACE("Testing getTables() : START\n"); { Reference<XResultSet> xRes = xDmd->getTables( - makeAny(OUString::createFromAscii("")), // Catalog - OUString::createFromAscii("%"), // Schema - OUString::createFromAscii("%"), // TabName + makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog + OUString(RTL_CONSTASCII_USTRINGPARAM("%")), // Schema + OUString(RTL_CONSTASCII_USTRINGPARAM("%")), // TabName Sequence<rtl::OUString>() ); printXResultSets( xRes ); } @@ -233,7 +235,7 @@ void TestQuery(Reference< ::com::sun::star::sdbc::XConnection> &pConnection) OSL_TRACE(": got statement\n"); OSL_TRACE(": excuteQuery() : START \n"); // SELECT "First Name", "Display Name", "E-mail" FROM tablename - OUString sqlPrefix= OUString::createFromAscii("SELECT \"First Name\", \"Display Name\", \"E-mail\" FROM "); + OUString sqlPrefix(RTL_CONSTASCII_USTRINGPARAM("SELECT \"First Name\", \"Display Name\", \"E-mail\" FROM ")); try { sal_Int32 times=0; @@ -244,9 +246,9 @@ void TestQuery(Reference< ::com::sun::star::sdbc::XConnection> &pConnection) OUString qut = xDmd->getIdentifierQuoteString(); Reference<XResultSet> xRes = xDmd->getTables( - makeAny(OUString::createFromAscii("")), // Catalog - OUString::createFromAscii("%"), // Schema - OUString::createFromAscii("%"), // TabName + makeAny(OUString(RTL_CONSTASCII_USTRINGPARAM(""))), // Catalog + OUString(RTL_CONSTASCII_USTRINGPARAM("%")), // Schema + OUString(RTL_CONSTASCII_USTRINGPARAM("%")), // TabName Sequence<rtl::OUString>() ); sal_Int32 nTables = 0; while( xRes.is() && xRes->next()) @@ -299,24 +301,24 @@ Reference< ::com::sun::star::sdbc::XConnection> TestConnected switch( nIndex) { case testLDAP: - url=OUString::createFromAscii("sdbc:address:ldap://"); + url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap://")); aValue.realloc(2); - aValue[0].Name = ::rtl::OUString::createFromAscii("HostName"); - aValue[0].Value <<= rtl::OUString::createFromAscii("sun-ds"); - aValue[1].Name = ::rtl::OUString::createFromAscii("BaseDN"); - aValue[1].Value <<= rtl::OUString::createFromAscii("dc=sun,dc=com"); + aValue[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HostName")); + aValue[0].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sun-ds")); + aValue[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseDN")); + aValue[1].Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dc=sun,dc=com")); break; case testMozilla: - url=OUString::createFromAscii("sdbc:address:mozilla://"); + url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:mozilla://")); break; case testOp: - url=OUString::createFromAscii("sdbc:address:outlook://"); + url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:outlook://")); break; case testOe: - url=OUString::createFromAscii("sdbc:address:outlookexp://"); + url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:outlookexp://")); break; default: - url=OUString::createFromAscii("sdbc:address:mozilla://"); + url=OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:mozilla://")); break; } pConnection = @@ -326,10 +328,10 @@ Reference< ::com::sun::star::sdbc::XConnection> TestConnected int autoTest(Reference<XResultSet> &xRes) { - sal_Int32 nRows = 0; printColumns(xRes); if(xRes.is()) { + sal_Int32 nRows = 0; while( xRes.is() && xRes->next()) { nRows++; @@ -363,7 +365,7 @@ void SAL_CALL mozThread(void*) { Reference< ::com::sun::star::sdbc::XDriver> m_xDriver(mMgr->createInstance( - OUString::createFromAscii("com.sun.star.comp.sdbc.MozabDriver")), + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdbc.MozabDriver"))), UNO_QUERY); if(m_xDriver.is()) { @@ -404,7 +406,7 @@ void usage() PRINTLN("-e test outlook express"); PRINTLN("0 < threadcount <= 100, default 100"); } -#if (defined UNX) || (defined OS2) +#if (defined UNX) int main( int argc, char * argv[] ) #else int _cdecl main( int argc, char * argv[] ) @@ -475,3 +477,4 @@ int _cdecl main( int argc, char * argv[] ) return 0; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |