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
5e4c2782
Kaydet (Commit)
5e4c2782
authored
Agu 14, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add first vba compression test
Change-Id: I9e3abebb0ac932b46f7fc96cd37d39023b783af2
üst
eaab276f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
84 additions
and
1 deletion
+84
-1
vbaexport.hxx
include/oox/ole/vbaexport.hxx
+1
-1
Module_oox.mk
oox/Module_oox.mk
+1
-0
simple1.bin
oox/qa/unit/data/vba/reference/simple1.bin
+0
-0
simple1.bin
oox/qa/unit/data/vba/simple1.bin
+1
-0
vba_compression.cxx
oox/qa/unit/vba_compression.cxx
+81
-0
No files found.
include/oox/ole/vbaexport.hxx
Dosyayı görüntüle @
5e4c2782
...
...
@@ -90,7 +90,7 @@ private:
sal_uInt16
handleHeader
(
bool
bCompressed
);
};
class
VBACompression
class
OOX_DLLPUBLIC
VBACompression
{
public
:
VBACompression
(
SvStream
&
rCompressedStream
,
...
...
oox/Module_oox.mk
Dosyayı görüntüle @
5e4c2782
...
...
@@ -18,6 +18,7 @@ $(eval $(call gb_Module_add_targets,oox,\
$(eval $(call gb_Module_add_check_targets,oox,\
CppunitTest_oox_tokenmap \
CppunitTest_oox_vba_compression \
))
# vim: set noet sw=4 ts=4:
oox/qa/unit/data/vba/reference/simple1.bin
0 → 100644
Dosyayı görüntüle @
5e4c2782
File added
oox/qa/unit/data/vba/simple1.bin
0 → 100644
Dosyayı görüntüle @
5e4c2782
00000000:0001 0203 0405 0607 0809 1011 1213 .
oox/qa/unit/vba_compression.cxx
0 → 100644
Dosyayı görüntüle @
5e4c2782
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <unotest/bootstrapfixturebase.hxx>
#include <cppunit/plugin/TestPlugIn.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/TestFixture.h>
#include <oox/ole/vbaexport.hxx>
class
TestVbaCompression
:
public
test
::
BootstrapFixtureBase
{
public
:
void
testSimple1
();
// avoid the BootstrapFixtureBase::setUp and tearDown
virtual
void
setUp
()
SAL_OVERRIDE
;
virtual
void
tearDown
()
SAL_OVERRIDE
;
CPPUNIT_TEST_SUITE
(
TestVbaCompression
);
CPPUNIT_TEST
(
testSimple1
);
CPPUNIT_TEST_SUITE_END
();
private
:
};
void
TestVbaCompression
::
testSimple1
()
{
OUString
aTestFile
=
getPathFromSrc
(
"/oox/qa/unit/data/vba/simple1.bin"
);
OUString
aReference
=
getPathFromSrc
(
"/oox/qa/unit/data/vba/reference/simple1.bin"
);
SvFileStream
aInputStream
(
aTestFile
,
StreamMode
::
READ
);
SvMemoryStream
aInputMemoryStream
(
4096
,
4096
);
aInputMemoryStream
.
WriteStream
(
aInputStream
);
SvMemoryStream
aOutputMemoryStream
(
4096
,
4096
);
VBACompression
aCompression
(
aOutputMemoryStream
,
aInputMemoryStream
);
aCompression
.
write
();
SvFileStream
aReferenceStream
(
aReference
,
StreamMode
::
READ
);
SvMemoryStream
aReferenceMemoryStream
(
4096
,
4096
);
aReferenceMemoryStream
.
WriteStream
(
aReferenceStream
);
aOutputMemoryStream
.
Seek
(
0
);
SvFileStream
aDebugStream
(
"/tmp/vba_debug.bin"
,
StreamMode
::
WRITE
);
aDebugStream
.
WriteStream
(
aOutputMemoryStream
);
// CPPUNIT_ASSERT_EQUAL(aReferenceMemoryStream.GetSize(), aOutputMemoryStream.GetSize());
const
sal_uInt8
*
pReferenceData
=
(
const
sal_uInt8
*
)
aReferenceMemoryStream
.
GetData
();
const
sal_uInt8
*
pData
=
(
const
sal_uInt8
*
)
aOutputMemoryStream
.
GetData
();
size_t
nSize
=
std
::
min
(
aReferenceMemoryStream
.
GetSize
(),
aOutputMemoryStream
.
GetSize
());
for
(
size_t
i
=
0
;
i
<
nSize
;
++
i
)
{
CPPUNIT_ASSERT_EQUAL
((
int
)
pReferenceData
[
i
],
(
int
)
pData
[
i
]);
}
}
void
TestVbaCompression
::
setUp
()
{
}
void
TestVbaCompression
::
tearDown
()
{
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
TestVbaCompression
);
CPPUNIT_PLUGIN_IMPLEMENT
();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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