summaryrefslogtreecommitdiff
path: root/smoketestoo_native
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-09-26 17:23:52 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-09-26 17:24:52 +0200
commitc09b966f94f5a50fe537916398451339f008947d (patch)
tree44c0f4ed30fab59c552dd656a0a64629a9f5d18e /smoketestoo_native
parentdaff51e125d1036895a5d39a7a652b3f5ff0e97e (diff)
In smoketest.cxx, also wait for connection_ going stale while waiting for result.condition.
Diffstat (limited to 'smoketestoo_native')
-rw-r--r--smoketestoo_native/smoketest.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/smoketestoo_native/smoketest.cxx b/smoketestoo_native/smoketest.cxx
index bb47b268d80b..f422ebc780c1 100644
--- a/smoketestoo_native/smoketest.cxx
+++ b/smoketestoo_native/smoketest.cxx
@@ -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);
}