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
c09b966f
Kaydet (Commit)
c09b966f
authored
Eyl 26, 2011
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
In smoketest.cxx, also wait for connection_ going stale while waiting for result.condition.
üst
daff51e1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
smoketest.cxx
smoketestoo_native/smoketest.cxx
+11
-3
officeconnection.hxx
test/inc/test/officeconnection.hxx
+3
-0
officeconnection.cxx
test/source/cpp/officeconnection.cxx
+9
-0
No files found.
smoketestoo_native/smoketest.cxx
Dosyayı görüntüle @
c09b966f
...
...
@@ -56,6 +56,7 @@
#include "cppunit/plugin/TestPlugIn.h"
#include "osl/conditn.hxx"
#include "osl/diagnose.h"
#include "osl/time.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
#include "test/gettestargument.hxx"
...
...
@@ -197,9 +198,16 @@ void Test::test() {
disp
,
url
,
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>
(),
new
Listener
(
&
result
)),
css
::
uno
::
Any
());
TimeValue
t
;
t
.
Seconds
=
30
;
t
.
Nanosec
=
0
;
result
.
condition
.
wait
(
&
t
);
// Wait for result.condition or connection_ going stale:
for
(;;)
{
TimeValue
delay
=
{
1
,
0
};
// 1 sec
osl
::
Condition
::
Result
res
=
result
.
condition
.
wait
(
&
delay
);
if
(
res
==
osl
::
Condition
::
result_ok
)
{
break
;
}
CPPUNIT_ASSERT_EQUAL
(
osl
::
Condition
::
result_timeout
,
res
);
CPPUNIT_ASSERT
(
connection_
.
isStillAlive
());
}
CPPUNIT_ASSERT
(
result
.
success
);
CPPUNIT_ASSERT_EQUAL
(
rtl
::
OUString
(),
result
.
result
);
}
...
...
test/inc/test/officeconnection.hxx
Dosyayı görüntüle @
c09b966f
...
...
@@ -55,6 +55,9 @@ public:
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
uno
::
XComponentContext
>
getComponentContext
()
const
;
// Must not be called before setUp or after tearDown:
bool
isStillAlive
()
const
;
private
:
oslProcess
process_
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
uno
::
XComponentContext
>
...
...
test/source/cpp/officeconnection.cxx
Dosyayı görüntüle @
c09b966f
...
...
@@ -170,6 +170,7 @@ void OfficeConnection::tearDown() {
osl_getProcessInfo
(
process_
,
osl_Process_EXITCODE
,
&
info
));
CPPUNIT_ASSERT_EQUAL
(
oslProcessExitCode
(
0
),
info
.
Code
);
osl_freeProcessHandle
(
process_
);
process_
=
0
;
// guard against subsequent calls to isStillAlive
}
}
...
...
@@ -178,6 +179,14 @@ OfficeConnection::getComponentContext() const {
return
context_
;
}
bool
OfficeConnection
::
isStillAlive
()
const
{
OSL_ASSERT
(
process_
!=
0
);
TimeValue
delay
=
{
0
,
0
};
// 0 sec
oslProcessError
e
=
osl_joinProcessWithTimeout
(
process_
,
&
delay
);
CPPUNIT_ASSERT
(
e
==
osl_Process_E_None
||
e
==
osl_Process_E_TimedOut
);
return
e
==
osl_Process_E_TimedOut
;
}
}
/* 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