summaryrefslogtreecommitdiffstats
path: root/sal
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-11-23 12:16:48 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-11-23 12:16:48 +0000
commit004222902fc154c6b31f623cf1e3409339b2af8c (patch)
treeacd45ea7e948d6d5cfccd32c2cc576f9cebd3d5a /sal
parentINTEGRATION: CWS sb79 (1.30.30); FILE MERGED (diff)
downloadcore-004222902fc154c6b31f623cf1e3409339b2af8c.tar.gz
core-004222902fc154c6b31f623cf1e3409339b2af8c.zip
INTEGRATION: CWS sb79 (1.10.76); FILE MERGED
2007/09/26 13:44:42 sb 1.10.76.1: #i78840# ImplEUCJPToUnicode erroneously added RTL_TEXTTOUNICODE_INFO_ERROR to RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL.
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/textenc/rtl_textcvt.cxx31
1 files changed, 29 insertions, 2 deletions
diff --git a/sal/qa/rtl/textenc/rtl_textcvt.cxx b/sal/qa/rtl/textenc/rtl_textcvt.cxx
index 971b0a2b2fce..150a9565378d 100644
--- a/sal/qa/rtl/textenc/rtl_textcvt.cxx
+++ b/sal/qa/rtl/textenc/rtl_textcvt.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: rtl_textcvt.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: obo $ $Date: 2007-03-14 08:28:34 $
+ * last change: $Author: ihi $ $Date: 2007-11-23 13:16:48 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -428,6 +428,8 @@ public:
void testComplexCut();
+ void testSRCBUFFERTOSMALL();
+
void testMime();
void testWindows();
@@ -438,6 +440,7 @@ public:
CPPUNIT_TEST(testSingleByte);
CPPUNIT_TEST(testComplex);
CPPUNIT_TEST(testComplexCut);
+ CPPUNIT_TEST(testSRCBUFFERTOSMALL);
CPPUNIT_TEST(testMime);
CPPUNIT_TEST(testWindows);
CPPUNIT_TEST(testInfo);
@@ -2563,6 +2566,30 @@ void Test::testComplexCut() {
}
}
+void Test::testSRCBUFFERTOSMALL() {
+ rtl_TextToUnicodeConverter cv = rtl_createTextToUnicodeConverter(
+ RTL_TEXTENCODING_EUC_JP);
+ OSL_ASSERT(cv != NULL);
+ rtl_TextToUnicodeContext cx = rtl_createTextToUnicodeContext(cv);
+ OSL_ASSERT(cx != NULL);
+ char src = '\xA1';
+ sal_Unicode dst[10];
+ sal_uInt32 info;
+ sal_Size cvt;
+ CPPUNIT_ASSERT_EQUAL(
+ sal_Size(0),
+ rtl_convertTextToUnicode(
+ cv, cx, &src, 1, dst, sizeof dst / sizeof (sal_Unicode),
+ (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR |
+ RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR),
+ &info, &cvt));
+ CPPUNIT_ASSERT_EQUAL(RTL_TEXTTOUNICODE_INFO_SRCBUFFERTOSMALL, info);
+ CPPUNIT_ASSERT(cvt <= 1);
+ rtl_destroyTextToUnicodeContext(cv, cx);
+ rtl_destroyTextToUnicodeConverter(cv);
+}
+
void Test::testMime() {
struct Data {
char const * mime;