summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-03-15 17:19:53 +0000
committerFridrich Strba <fridrich@documentfoundation.org>2013-03-15 21:57:59 +0000
commitd4b4a6a88bbab383cef4bf4076a84e19efa509ac (patch)
tree630fb496eeadb0aca8e591ce719998bfc43b5827 /basic
parentdd59a0a039fe4bd509d5fe456e7d6ea865bb307e (diff)
unittest and test data for bnc#809017
Change-Id: I3ccae692db44bb3ce41b371f0b511a9db7181bf4 Reviewed-on: https://gerrit.libreoffice.org/2759 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/cppunit/test_vba.cxx7
-rw-r--r--basic/qa/vba_tests/ole_dfltObjDflMethod.vb24
2 files changed, 28 insertions, 3 deletions
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index abb929f95889..65338a96697f 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -22,7 +22,7 @@ namespace
VBATest() : BootstrapFixture(true, false) {}
~VBATest(){}
void testMiscVBAFunctions();
- void testObjAssignWithDefaultMember();
+ void testMiscOLEStuff();
// Adds code needed to register the test suite
CPPUNIT_TEST_SUITE(VBATest);
@@ -30,7 +30,7 @@ namespace
CPPUNIT_TEST(testMiscVBAFunctions);
// not much point even trying to run except on windows
#if defined(WNT)
- CPPUNIT_TEST(testObjAssignWithDefaultMember);
+ CPPUNIT_TEST(testMiscOLEStuff);
#endif
// End of test suite definition
@@ -105,7 +105,7 @@ void VBATest::testMiscVBAFunctions()
}
}
-void VBATest::testObjAssignWithDefaultMember()
+void VBATest::testMiscOLEStuff()
{
bool bCanRunOleTests = hasOLEEnv();
if ( !bCanRunOleTests )
@@ -114,6 +114,7 @@ void VBATest::testObjAssignWithDefaultMember()
const char* macroSource[] = {
"ole_ObjAssignNoDflt.vb",
"ole_ObjAssignToNothing.vb",
+ "ole_dfltObjDflMethod.vb",
};
OUString sMacroPathURL = getURLFromSrc("/basic/qa/vba_tests/");
diff --git a/basic/qa/vba_tests/ole_dfltObjDflMethod.vb b/basic/qa/vba_tests/ole_dfltObjDflMethod.vb
new file mode 100644
index 000000000000..f24786098e48
--- /dev/null
+++ b/basic/qa/vba_tests/ole_dfltObjDflMethod.vb
@@ -0,0 +1,24 @@
+Option VBASupport 1
+Option Explicit
+
+Rem Test accessing an object that has default object member
+Rem which in turn has a default member that is a method
+Function doUnitTest(TestData As String) As String
+doUnitTest = "Begin"
+Dim modifiedTimout As Long
+Dim cnn1 As New ADODB.Connection
+Dim rst1 As New ADODB.Recordset
+Dim conStr As String
+cnn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
+"Data Source=" & TestData & ";" & _
+"Extended Properties=""Excel 8.0;HDR=Yes"";"
+rst1.Open "SELECT * FROM [Sheet1$];", cnn1, adOpenStatic, adLockReadOnly
+Dim val
+val = rst1("FirstName")
+If val = "Paddy" Then
+ doUnitTest = "OK"
+Else
+ doUnitTest = "Failed, expected 'Paddy' got " & val
+End If
+
+End Function