summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-03-04 20:27:33 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-03-04 20:27:33 -0500
commit6299330c2ab861671f9ac5171f81dea6ef96664c (patch)
tree64c5acee1e814701270e1a23d9440bd91a3131c5 /sc/qa
parent1b9fc8e85daeda7179ce197296e65076ac00f327 (diff)
Unit test for text and text number inputs.
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/ucalc.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 358c4f10784c..f76148e0c676 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -228,6 +228,7 @@ public:
bool testLoad(const rtl::OUString &rFilter, const rtl::OUString &rURL);
void testCollator();
+ void testInput();
void testSUM();
void testVolatileFunc();
void testNamedRange();
@@ -251,6 +252,7 @@ public:
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testCollator);
+ CPPUNIT_TEST(testInput);
CPPUNIT_TEST(testSUM);
CPPUNIT_TEST(testVolatileFunc);
CPPUNIT_TEST(testNamedRange);
@@ -333,6 +335,28 @@ void Test::testCollator()
CPPUNIT_ASSERT_MESSAGE("these strings are supposed to be different!", nRes != 0);
}
+void Test::testInput()
+{
+ rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("foo"));
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet",
+ m_pDoc->InsertTab (0, aTabName));
+
+ OUString numstr(RTL_CONSTASCII_USTRINGPARAM("'10.5"));
+ OUString str(RTL_CONSTASCII_USTRINGPARAM("'apple'"));
+ OUString test;
+
+ m_pDoc->SetString(0, 0, 0, numstr);
+ m_pDoc->GetString(0, 0, 0, test);
+ bool bTest = test.equalsAscii("10.5");
+ CPPUNIT_ASSERT_MESSAGE("String number should have the first apostrophe stripped.", bTest);
+ m_pDoc->SetString(0, 0, 0, str);
+ m_pDoc->GetString(0, 0, 0, test);
+ bTest = test.equalsAscii("'apple'");
+ CPPUNIT_ASSERT_MESSAGE("Text content should have retained the first apostrophe.", bTest);
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testSUM()
{
rtl::OUString aTabName(RTL_CONSTASCII_USTRINGPARAM("foo"));