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
82fb80ec
Kaydet (Commit)
82fb80ec
authored
Agu 24, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make test order deterministic
Change-Id: I9980034f0cb948acd6bb20aaf0fc27928ac68913
üst
02e9b490
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
6 deletions
+23
-6
filters-test.cxx
unotest/source/cpp/filters-test.cxx
+23
-6
No files found.
unotest/source/cpp/filters-test.cxx
Dosyayı görüntüle @
82fb80ec
...
@@ -7,6 +7,10 @@
...
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
*/
#include <sal/config.h>
#include <set>
#include <unotest/filters-test.hxx>
#include <unotest/filters-test.hxx>
#include <osl/file.hxx>
#include <osl/file.hxx>
#include <osl/thread.h>
#include <osl/thread.h>
...
@@ -60,17 +64,26 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
...
@@ -60,17 +64,26 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aDir
.
open
());
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aDir
.
open
());
osl
::
DirectoryItem
aItem
;
osl
::
DirectoryItem
aItem
;
osl
::
FileStatus
aFileStatus
(
osl_FileStatus_Mask_FileURL
|
osl_FileStatus_Mask_Type
);
osl
::
FileStatus
aFileStatus
(
osl_FileStatus_Mask_FileURL
|
osl_FileStatus_Mask_Type
);
std
::
set
<
OUString
>
dirs
;
std
::
set
<
OUString
>
files
;
while
(
aDir
.
getNextItem
(
aItem
)
==
osl
::
FileBase
::
E_None
)
while
(
aDir
.
getNextItem
(
aItem
)
==
osl
::
FileBase
::
E_None
)
{
{
aItem
.
getFileStatus
(
aFileStatus
);
aItem
.
getFileStatus
(
aFileStatus
);
OUString
sURL
=
aFileStatus
.
getFileURL
();
OUString
sURL
=
aFileStatus
.
getFileURL
();
if
(
aFileStatus
.
getFileType
()
==
osl
::
FileStatus
::
Directory
)
if
(
aFileStatus
.
getFileType
()
==
osl
::
FileStatus
::
Directory
)
{
{
recursiveScan
(
nExpected
,
rFilter
,
sURL
,
rUserData
,
dirs
.
insert
(
sURL
);
nFilterFlags
,
nClipboardID
,
nFilterVersion
,
bExport
);
}
}
else
else
{
{
files
.
insert
(
sURL
);
}
}
for
(
auto
const
&
sURL
:
dirs
)
{
recursiveScan
(
nExpected
,
rFilter
,
sURL
,
rUserData
,
nFilterFlags
,
nClipboardID
,
nFilterVersion
,
bExport
);
}
for
(
auto
const
&
sURL
:
files
)
{
OUString
sTmpFile
;
OUString
sTmpFile
;
bool
bEncrypted
=
false
;
bool
bEncrypted
=
false
;
...
@@ -95,11 +108,16 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
...
@@ -95,11 +108,16 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
OString
aRes
(
OUStringToOString
(
sURL
,
OString
aRes
(
OUStringToOString
(
sURL
,
osl_getThreadTextEncoding
()));
osl_getThreadTextEncoding
()));
OUString
realUrl
;
if
(
bEncrypted
)
if
(
bEncrypted
)
{
{
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
osl
::
FileBase
::
createTempFile
(
NULL
,
NULL
,
&
sTmpFile
));
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
osl
::
FileBase
::
createTempFile
(
NULL
,
NULL
,
&
sTmpFile
));
decode
(
sURL
,
sTmpFile
);
decode
(
sURL
,
sTmpFile
);
sURL
=
sTmpFile
;
realUrl
=
sTmpFile
;
}
else
{
realUrl
=
sURL
;
}
}
//output name early, so in the case of a hang, the name of
//output name early, so in the case of a hang, the name of
...
@@ -108,10 +126,10 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
...
@@ -108,10 +126,10 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
sal_uInt32
nStartTime
=
osl_getGlobalTimer
();
sal_uInt32
nStartTime
=
osl_getGlobalTimer
();
bool
bRes
;
bool
bRes
;
if
(
!
bExport
)
if
(
!
bExport
)
bRes
=
load
(
rFilter
,
sURL
,
rUserData
,
nFilterFlags
,
bRes
=
load
(
rFilter
,
realUrl
,
rUserData
,
nFilterFlags
,
nClipboardID
,
nFilterVersion
);
nClipboardID
,
nFilterVersion
);
else
else
bRes
=
save
(
rFilter
,
sURL
,
rUserData
,
nFilterFlags
,
bRes
=
save
(
rFilter
,
realUrl
,
rUserData
,
nFilterFlags
,
nClipboardID
,
nFilterVersion
);
nClipboardID
,
nFilterVersion
);
sal_uInt32
nEndTime
=
osl_getGlobalTimer
();
sal_uInt32
nEndTime
=
osl_getGlobalTimer
();
...
@@ -125,7 +143,6 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
...
@@ -125,7 +143,6 @@ void FiltersTest::recursiveScan(filterStatus nExpected,
filterStatus
nResult
=
bRes
?
test
::
pass
:
test
::
fail
;
filterStatus
nResult
=
bRes
?
test
::
pass
:
test
::
fail
;
CPPUNIT_ASSERT_MESSAGE
(
aRes
.
getStr
(),
nResult
==
nExpected
);
CPPUNIT_ASSERT_MESSAGE
(
aRes
.
getStr
(),
nResult
==
nExpected
);
}
}
}
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aDir
.
close
());
CPPUNIT_ASSERT
(
osl
::
FileBase
::
E_None
==
aDir
.
close
());
}
}
...
...
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