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
a5847cff
Kaydet (Commit)
a5847cff
authored
May 09, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1297235 Uncaught exception
Change-Id: I6b135f6d47352c1fbb729788848913402b7bb742
üst
a1a3e047
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
65 deletions
+74
-65
cppunittester.cxx
sal/cppunittester/cppunittester.cxx
+74
-65
No files found.
sal/cppunittester/cppunittester.cxx
Dosyayı görüntüle @
a5847cff
...
@@ -294,85 +294,94 @@ public:
...
@@ -294,85 +294,94 @@ public:
}
}
SAL_IMPLEMENT_MAIN
()
{
SAL_IMPLEMENT_MAIN
()
{
bool
ok
=
false
;
try
{
#ifdef WNT
#ifdef WNT
//Disable Dr-Watson in order to crash simply without popup dialogs under
//Disable Dr-Watson in order to crash simply without popup dialogs under
//windows
//windows
DWORD
dwMode
=
SetErrorMode
(
SEM_NOGPFAULTERRORBOX
);
DWORD
dwMode
=
SetErrorMode
(
SEM_NOGPFAULTERRORBOX
);
SetErrorMode
(
SEM_NOGPFAULTERRORBOX
|
dwMode
);
SetErrorMode
(
SEM_NOGPFAULTERRORBOX
|
dwMode
);
#ifdef _DEBUG // These functions are present only in the debgging runtime
#ifdef _DEBUG // These functions are present only in the debgging runtime
_CrtSetReportMode
(
_CRT_WARN
,
_CRTDBG_MODE_DEBUG
|
_CRTDBG_MODE_FILE
);
_CrtSetReportMode
(
_CRT_WARN
,
_CRTDBG_MODE_DEBUG
|
_CRTDBG_MODE_FILE
);
_CrtSetReportFile
(
_CRT_WARN
,
_CRTDBG_FILE_STDERR
);
_CrtSetReportFile
(
_CRT_WARN
,
_CRTDBG_FILE_STDERR
);
_CrtSetReportMode
(
_CRT_ERROR
,
_CRTDBG_MODE_DEBUG
|
_CRTDBG_MODE_FILE
);
_CrtSetReportMode
(
_CRT_ERROR
,
_CRTDBG_MODE_DEBUG
|
_CRTDBG_MODE_FILE
);
_CrtSetReportFile
(
_CRT_ERROR
,
_CRTDBG_FILE_STDERR
);
_CrtSetReportFile
(
_CRT_ERROR
,
_CRTDBG_FILE_STDERR
);
_CrtSetReportMode
(
_CRT_ASSERT
,
_CRTDBG_MODE_DEBUG
|
_CRTDBG_MODE_FILE
);
_CrtSetReportMode
(
_CRT_ASSERT
,
_CRTDBG_MODE_DEBUG
|
_CRTDBG_MODE_FILE
);
_CrtSetReportFile
(
_CRT_ASSERT
,
_CRTDBG_FILE_STDERR
);
_CrtSetReportFile
(
_CRT_ASSERT
,
_CRTDBG_FILE_STDERR
);
#endif
#endif
#endif
#endif
std
::
vector
<
CppUnit
::
Protector
*>
protectors
;
std
::
vector
<
CppUnit
::
Protector
*>
protectors
;
CppUnit
::
TestResult
result
;
CppUnit
::
TestResult
result
;
std
::
string
args
;
std
::
string
args
;
std
::
string
testlib
;
std
::
string
testlib
;
sal_uInt32
index
=
0
;
sal_uInt32
index
=
0
;
while
(
index
<
rtl_getAppCommandArgCount
())
while
(
index
<
rtl_getAppCommandArgCount
())
{
rtl
::
OUString
arg
=
getArgument
(
index
);
if
(
arg
!=
"--protector"
)
{
{
if
(
testlib
.
empty
())
rtl
::
OUString
arg
=
getArgument
(
index
);
if
(
arg
!=
"--protector"
)
{
{
testlib
=
rtl
::
OUStringToOString
(
arg
,
osl_getThreadTextEncoding
()).
getStr
();
if
(
testlib
.
empty
())
args
+=
testlib
;
{
testlib
=
rtl
::
OUStringToOString
(
arg
,
osl_getThreadTextEncoding
()).
getStr
();
args
+=
testlib
;
}
else
{
args
+=
' '
;
args
+=
rtl
::
OUStringToOString
(
arg
,
osl_getThreadTextEncoding
()).
getStr
();
}
++
index
;
continue
;
}
}
else
if
(
rtl_getAppCommandArgCount
()
-
index
<
3
)
{
{
usageFailure
();
args
+=
' '
;
args
+=
rtl
::
OUStringToOString
(
arg
,
osl_getThreadTextEncoding
()).
getStr
();
}
}
++
index
;
rtl
::
OUString
lib
(
getArgument
(
index
+
1
));
continue
;
rtl
::
OUString
sym
(
getArgument
(
index
+
2
));
}
if
(
rtl_getAppCommandArgCount
()
-
index
<
3
)
{
usageFailure
();
}
rtl
::
OUString
lib
(
getArgument
(
index
+
1
));
rtl
::
OUString
sym
(
getArgument
(
index
+
2
));
#ifndef DISABLE_DYNLOADING
#ifndef DISABLE_DYNLOADING
osl
::
Module
mod
(
lib
,
SAL_LOADMODULE_GLOBAL
);
osl
::
Module
mod
(
lib
,
SAL_LOADMODULE_GLOBAL
);
oslGenericFunction
fn
=
mod
.
getFunctionSymbol
(
sym
);
oslGenericFunction
fn
=
mod
.
getFunctionSymbol
(
sym
);
mod
.
release
();
mod
.
release
();
#else
#else
oslGenericFunction
fn
=
0
;
oslGenericFunction
fn
=
0
;
if
(
sym
==
"unoexceptionprotector"
)
if
(
sym
==
"unoexceptionprotector"
)
fn
=
(
oslGenericFunction
)
unoexceptionprotector
;
fn
=
(
oslGenericFunction
)
unoexceptionprotector
;
else
if
(
sym
==
"unobootstrapprotector"
)
else
if
(
sym
==
"unobootstrapprotector"
)
fn
=
(
oslGenericFunction
)
unobootstrapprotector
;
fn
=
(
oslGenericFunction
)
unobootstrapprotector
;
else
if
(
sym
==
"vclbootstrapprotector"
)
else
if
(
sym
==
"vclbootstrapprotector"
)
fn
=
(
oslGenericFunction
)
vclbootstrapprotector
;
fn
=
(
oslGenericFunction
)
vclbootstrapprotector
;
else
else
{
{
std
::
cerr
std
::
cerr
<<
"Only unoexceptionprotector or unobootstrapprotector protectors allowed"
<<
"Only unoexceptionprotector or unobootstrapprotector protectors allowed"
<<
std
::
endl
;
<<
std
::
endl
;
std
::
exit
(
EXIT_FAILURE
);
std
::
exit
(
EXIT_FAILURE
);
}
}
#endif
#endif
CppUnit
::
Protector
*
protector
=
fn
==
0
CppUnit
::
Protector
*
protector
=
fn
==
0
?
0
?
0
:
(
*
reinterpret_cast
<
cppunittester
::
ProtectorFactory
*
>
(
fn
))();
:
(
*
reinterpret_cast
<
cppunittester
::
ProtectorFactory
*
>
(
fn
))();
if
(
protector
==
0
)
{
if
(
protector
==
0
)
{
std
::
cerr
std
::
cerr
<<
"Failure instantiating protector
\"
"
<<
convertLazy
(
lib
)
<<
"Failure instantiating protector
\"
"
<<
convertLazy
(
lib
)
<<
"
\"
,
\"
"
<<
convertLazy
(
sym
)
<<
'"'
<<
std
::
endl
;
<<
"
\"
,
\"
"
<<
convertLazy
(
sym
)
<<
'"'
<<
std
::
endl
;
std
::
exit
(
EXIT_FAILURE
);
std
::
exit
(
EXIT_FAILURE
);
}
protectors
.
push_back
(
protector
);
index
+=
3
;
}
}
protectors
.
push_back
(
protector
);
index
+=
3
;
}
ProtectedFixtureFunctor
tests
(
testlib
,
args
,
protectors
,
result
);
ProtectedFixtureFunctor
tests
(
testlib
,
args
,
protectors
,
result
);
bool
ok
=
tests
.
run
();
ok
=
tests
.
run
();
}
catch
(
const
std
::
exception
&
e
)
{
SAL_WARN
(
"vcl.app"
,
"Fatal exception: "
<<
e
.
what
());
}
return
ok
?
EXIT_SUCCESS
:
EXIT_FAILURE
;
return
ok
?
EXIT_SUCCESS
:
EXIT_FAILURE
;
}
}
...
...
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