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
dd71d384
Kaydet (Commit)
dd71d384
authored
Eyl 30, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rtl_cipher_decode doesn't like 0 len data
üst
e898bcc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
filters-test.cxx
test/source/filters-test.cxx
+8
-10
No files found.
test/source/filters-test.cxx
Dosyayı görüntüle @
dd71d384
...
@@ -54,19 +54,18 @@ void decode(const rtl::OUString& rIn, const rtl::OUString &rOut)
...
@@ -54,19 +54,18 @@ void decode(const rtl::OUString& rIn, const rtl::OUString &rOut)
osl
::
File
aOut
(
rOut
);
osl
::
File
aOut
(
rOut
);
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aOut
.
open
(
osl_File_OpenFlag_Write
));
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aOut
.
open
(
osl_File_OpenFlag_Write
));
fprintf
(
stderr
,
"rOut is %s
\n
"
,
rtl
::
OUStringToOString
(
rOut
,
RTL_TEXTENCODING_UTF8
).
getStr
());
sal_uInt8
in
[
8192
];
sal_uInt8
in
[
8192
];
sal_uInt8
out
[
8192
];
sal_uInt8
out
[
8192
];
sal_uInt64
nBytesRead
,
nBytesWritten
;
sal_uInt64
nBytesRead
,
nBytesWritten
;
do
while
(
1
)
{
{
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aIn
.
read
(
in
,
sizeof
(
in
),
nBytesRead
));
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aIn
.
read
(
in
,
sizeof
(
in
),
nBytesRead
));
if
(
!
nBytesRead
)
break
;
CPPUNIT_ASSERT
(
rtl_Cipher_E_None
==
rtl_cipher_decode
(
cipher
,
in
,
nBytesRead
,
out
,
sizeof
(
out
)));
CPPUNIT_ASSERT
(
rtl_Cipher_E_None
==
rtl_cipher_decode
(
cipher
,
in
,
nBytesRead
,
out
,
sizeof
(
out
)));
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aOut
.
write
(
out
,
nBytesRead
,
nBytesWritten
));
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aOut
.
write
(
out
,
nBytesRead
,
nBytesWritten
));
CPPUNIT_ASSERT
(
nBytesRead
==
nBytesWritten
);
CPPUNIT_ASSERT
(
nBytesRead
==
nBytesWritten
);
}
}
while
(
nBytesRead
==
sizeof
(
in
));
rtl_cipher_destroy
(
cipher
);
rtl_cipher_destroy
(
cipher
);
}
}
...
@@ -96,11 +95,9 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
...
@@ -96,11 +95,9 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
{
{
//ignore .files
//ignore .files
if
(
sURL
.
getStr
()[
nLastSlash
+
1
]
==
'.'
)
if
(
sURL
.
getStr
()[
nLastSlash
+
1
]
==
'.'
)
{
continue
;
continue
;
}
if
(
sURL
.
matchAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"CVE"
)
),
nLastSlash
+
1
)
if
(
sURL
.
matchAsciiL
(
RTL_CONSTASCII_STRINGPARAM
(
"CVE"
)
,
nLastSlash
+
1
)
)
bCVE
=
true
;
bCVE
=
true
;
}
}
...
@@ -109,9 +106,7 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
...
@@ -109,9 +106,7 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
if
(
bCVE
)
if
(
bCVE
)
{
{
osl
::
FileBase
::
RC
err
=
osl
::
FileBase
::
createTempFile
(
NULL
,
NULL
,
&
sTmpFile
);
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
osl
::
FileBase
::
createTempFile
(
NULL
,
NULL
,
&
sTmpFile
));
CPPUNIT_ASSERT_MESSAGE
(
"temp File creation failed"
,
err
==
osl
::
FileBase
::
E_None
);
decode
(
sURL
,
sTmpFile
);
decode
(
sURL
,
sTmpFile
);
sURL
=
sTmpFile
;
sURL
=
sTmpFile
;
}
}
...
@@ -124,6 +119,9 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
...
@@ -124,6 +119,9 @@ void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUStrin
bool
bRes
=
load
(
rFilter
,
sURL
,
rUserData
);
bool
bRes
=
load
(
rFilter
,
sURL
,
rUserData
);
sal_uInt32
nEndTime
=
osl_getGlobalTimer
();
sal_uInt32
nEndTime
=
osl_getGlobalTimer
();
if
(
bCVE
)
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
osl
::
File
::
remove
(
sTmpFile
));
if
(
nExpected
==
test
::
indeterminate
)
if
(
nExpected
==
test
::
indeterminate
)
{
{
fprintf
(
stderr
,
"%s,%"
SAL_PRIuUINT32
"
\n
"
,
fprintf
(
stderr
,
"%s,%"
SAL_PRIuUINT32
"
\n
"
,
...
...
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