Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2a6976df
Kaydet (Commit)
2a6976df
authored
Kas 13, 2013
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
-Werror,-Wunused-member-function
Change-Id: I32e4a80e99885c561a30e8f059c9b9a24c4bd3c7
üst
1b3e9bcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
34 deletions
+24
-34
test_vba.cxx
basic/qa/cppunit/test_vba.cxx
+24
-34
No files found.
basic/qa/cppunit/test_vba.cxx
Dosyayı görüntüle @
2a6976df
...
@@ -17,7 +17,6 @@ namespace
...
@@ -17,7 +17,6 @@ namespace
class
VBATest
:
public
test
::
BootstrapFixture
class
VBATest
:
public
test
::
BootstrapFixture
{
{
bool
hasOLEEnv
();
public
:
public
:
VBATest
()
:
BootstrapFixture
(
true
,
false
)
{}
VBATest
()
:
BootstrapFixture
(
true
,
false
)
{}
~
VBATest
(){}
~
VBATest
(){}
...
@@ -28,44 +27,13 @@ namespace
...
@@ -28,44 +27,13 @@ namespace
// Declares the method as a test to call
// Declares the method as a test to call
CPPUNIT_TEST
(
testMiscVBAFunctions
);
CPPUNIT_TEST
(
testMiscVBAFunctions
);
// not much point even trying to run except on windows
#if defined(WNT)
CPPUNIT_TEST
(
testMiscOLEStuff
);
CPPUNIT_TEST
(
testMiscOLEStuff
);
#endif
// End of test suite definition
// End of test suite definition
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
};
};
bool
VBATest
::
hasOLEEnv
()
{
// test if we have the necessary runtime environment
// to run the OLE tests.
static
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xOLEFactory
;
if
(
!
xOLEFactory
.
is
()
)
{
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
(
comphelper
::
getProcessComponentContext
()
);
if
(
xContext
.
is
()
)
{
uno
::
Reference
<
lang
::
XMultiComponentFactory
>
xSMgr
=
xContext
->
getServiceManager
();
xOLEFactory
=
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
(
xSMgr
->
createInstanceWithContext
(
"com.sun.star.bridge.OleObjectFactory"
,
xContext
),
uno
::
UNO_QUERY
);
}
}
bool
bOk
=
false
;
if
(
xOLEFactory
.
is
()
)
{
uno
::
Reference
<
uno
::
XInterface
>
xExcel
=
xOLEFactory
->
createInstance
(
"Excel.Application"
);
uno
::
Reference
<
uno
::
XInterface
>
xADODB
=
xOLEFactory
->
createInstance
(
"ADODB.Connection"
);
bOk
=
xExcel
.
is
()
&&
xADODB
.
is
();
}
return
bOk
;
}
void
VBATest
::
testMiscVBAFunctions
()
void
VBATest
::
testMiscVBAFunctions
()
{
{
const
char
*
macroSource
[]
=
{
const
char
*
macroSource
[]
=
{
...
@@ -107,8 +75,29 @@ void VBATest::testMiscVBAFunctions()
...
@@ -107,8 +75,29 @@ void VBATest::testMiscVBAFunctions()
void
VBATest
::
testMiscOLEStuff
()
void
VBATest
::
testMiscOLEStuff
()
{
{
bool
bCanRunOleTests
=
hasOLEEnv
();
// not much point even trying to run except on windows
if
(
!
bCanRunOleTests
)
#if defined(WNT)
// test if we have the necessary runtime environment
// to run the OLE tests.
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
xOLEFactory
;
uno
::
Reference
<
uno
::
XComponentContext
>
xContext
(
comphelper
::
getProcessComponentContext
()
);
if
(
xContext
.
is
()
)
{
uno
::
Reference
<
lang
::
XMultiComponentFactory
>
xSMgr
=
xContext
->
getServiceManager
();
xOLEFactory
=
uno
::
Reference
<
lang
::
XMultiServiceFactory
>
(
xSMgr
->
createInstanceWithContext
(
"com.sun.star.bridge.OleObjectFactory"
,
xContext
),
uno
::
UNO_QUERY
);
}
bool
bOk
=
false
;
if
(
xOLEFactory
.
is
()
)
{
uno
::
Reference
<
uno
::
XInterface
>
xExcel
=
xOLEFactory
->
createInstance
(
"Excel.Application"
);
uno
::
Reference
<
uno
::
XInterface
>
xADODB
=
xOLEFactory
->
createInstance
(
"ADODB.Connection"
);
bOk
=
xExcel
.
is
()
&&
xADODB
.
is
();
}
if
(
!
bOk
)
return
;
// can't do anything, skip test
return
;
// can't do anything, skip test
const
char
*
macroSource
[]
=
{
const
char
*
macroSource
[]
=
{
...
@@ -142,6 +131,7 @@ void VBATest::testMiscOLEStuff()
...
@@ -142,6 +131,7 @@ void VBATest::testMiscOLEStuff()
CPPUNIT_ASSERT_MESSAGE
(
"No return variable huh?"
,
pReturn
!=
NULL
);
CPPUNIT_ASSERT_MESSAGE
(
"No return variable huh?"
,
pReturn
!=
NULL
);
CPPUNIT_ASSERT_MESSAGE
(
"Result not as expected"
,
pReturn
->
GetOUString
()
==
"OK"
);
CPPUNIT_ASSERT_MESSAGE
(
"Result not as expected"
,
pReturn
->
GetOUString
()
==
"OK"
);
}
}
#endif
}
}
// Put the test suite in the registry
// Put the test suite in the registry
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment