summaryrefslogtreecommitdiff
path: root/sal/qa/ByteSequence
diff options
context:
space:
mode:
authorMindy Liu <mindyliu@openoffice.org>2003-03-18 09:42:09 +0000
committerMindy Liu <mindyliu@openoffice.org>2003-03-18 09:42:09 +0000
commitc93f1309314167d785b284312524e40313015f34 (patch)
treeeec86a3a037a0f44212f50bbe8d6443c3d3884dd /sal/qa/ByteSequence
parent108c839bba66ad25c329070dc9990e24c582164c (diff)
getdata_001 updated
Diffstat (limited to 'sal/qa/ByteSequence')
-rw-r--r--sal/qa/ByteSequence/ByteSequence.cxx50
1 files changed, 18 insertions, 32 deletions
diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx
index 1693ff0cf168..5682b57c7e80 100644
--- a/sal/qa/ByteSequence/ByteSequence.cxx
+++ b/sal/qa/ByteSequence/ByteSequence.cxx
@@ -1,8 +1,3 @@
-// autogenerated file with codegen.pl
-
-//#ifndef _RTL_BYTESEQ_HXX_
-//#define _RTL_BYTESEQ_HXX_
-//#endif
#ifndef _BYTE_CONST_H_
#include <Byte_Const.h>
@@ -18,7 +13,6 @@
using namespace rtl;
-
namespace rtl_ByteSequence
{
@@ -82,10 +76,6 @@ class ctor : public CppUnit::TestFixture
sal_Int32 len = kTestByteCount1;
::rtl::ByteSequence aByteSeq( pElements, len);
sal_Int32 nNewLen = aByteSeq.getLength();
- printf("# the kTestByte4 is %d\n", kTestByte4);
- printf("# the aByteSeq[0] is %d\n", aByteSeq[0]);
- printf("# the aByteSeq[1] is %d\n", aByteSeq[1]);
- printf("# the aByteSeq[2] is %d\n", aByteSeq[2]);
CPPUNIT_ASSERT_MESSAGE
(
"Creates a copy of given data bytes",
@@ -129,11 +119,6 @@ class ctor : public CppUnit::TestFixture
void ctor_007()
{
- //sal_Sequence *pSequence;
- //pSequence = new sal_Sequence;
- //pSequence->nRefCount = 1;
- //pSequence->nElements = kTestByteCount1;
- //pSequence->elements[1] = kTestChar;
::rtl::ByteSequence aByteSeq( &kTestByteSeq3, BYTESEQ_NOACQUIRE );
sal_Int32 nNewLen = aByteSeq.getLength();
CPPUNIT_ASSERT_MESSAGE
@@ -173,7 +158,7 @@ public:
sal_Int32 len = kTestByteCount1;
sal_Int32 len2 = len - 1;
sal_Int8 * pElements = &kTestByte;
- ::rtl::ByteSequence aByteSeq1( pElements, len);
+ ::rtl::ByteSequence aByteSeq1( kTestByte5, len);
::rtl::ByteSequence aByteSeq2( pElements, len2);
aByteSeq2 = aByteSeq1;
sal_Int32 nNewLen = aByteSeq2.getLength();
@@ -261,7 +246,6 @@ public:
sal_Int8 * pElements = &kTestByte;
::rtl::ByteSequence aByteSeq1( pElements, len-1);
::rtl::ByteSequence aByteSeq2( pElements, len);
- //aByteSeq2 = aByteSeq1;
sal_Bool res = aByteSeq1 == aByteSeq2;
CPPUNIT_ASSERT_MESSAGE
(
@@ -482,11 +466,6 @@ public:
);
}
-
- // Change the following lines only, if you add, remove or rename
- // member functions of the current class,
- // because these macros are need by auto register mechanism.
-
CPPUNIT_TEST_SUITE(realloc);
CPPUNIT_TEST(realloc_001);
CPPUNIT_TEST(realloc_002);
@@ -510,16 +489,28 @@ public:
}
// insert your test code here.
- /*void getData_001()
+ void getData_001()
{
- ::rtl::ByteSequence aByteSeq;
+ sal_Int8 * pElements = kTestByte5;
+ ::rtl::ByteSequence aByteSeq(pElements, 4);
+ sal_Bool res = sal_True;
+ if (aByteSeq[0] != kTestByte)
+ res = sal_False;
+
+ if (aByteSeq[1] != kTestByte1)
+ res = sal_False;
+ printf("# aByteSeq[1] is %d\n", aByteSeq[1]);
+ printf("# aByteSeq[2] is %d\n", aByteSeq[2]);
+ printf("# aByteSeq[3] is %d\n", aByteSeq[3]);
+ printf("# aByteSeq[4] is %d\n", aByteSeq[4]);
+
CPPUNIT_ASSERT_MESSAGE
(
"Obtains a reference to byte indexed at given position: empty sequence",
- aByteSeq[0] == 0
+ res == sal_True
);
}
-*/
+
void getData_002()
{
::rtl::ByteSequence aByteSeq( &kTestByteSeq2 );
@@ -535,10 +526,6 @@ public:
{
::rtl::ByteSequence aByteSeq( &kTestByteSeq3 );
sal_Int8 nValue = aByteSeq[0];
- printf("# the kTestChar3 is %d\n", kTestChar3);
- printf("# the aByteSeq[0] is %d\n", aByteSeq[0]);
- printf("# the aByteSeq[1] is %d\n", aByteSeq[1]);
- printf("# the aByteSeq[2] is %d\n", aByteSeq[2]);
CPPUNIT_ASSERT_MESSAGE
(
"Obtains a reference to byte indexed at given position: reference count = 1",
@@ -547,7 +534,7 @@ public:
}
CPPUNIT_TEST_SUITE(getData);
-// CPPUNIT_TEST(getData_001);
+ CPPUNIT_TEST(getData_001);
CPPUNIT_TEST(getData_002);
CPPUNIT_TEST(getData_003);
CPPUNIT_TEST_SUITE_END();
@@ -569,4 +556,3 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_ByteSequence::getData, "rtl_ByteSequen
// this macro creates an empty function, which will called by the RegisterAllFunctions()
// to let the user the possibility to also register some functions by hand.
NOADDITIONAL;
-