summaryrefslogtreecommitdiff
path: root/cpp/test/ios/controller/Bundle
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2017-06-23 18:19:42 -0400
committerBernard Normier <bernard@zeroc.com>2017-06-23 18:19:42 -0400
commit4b5aff6c604161e890234befc34a43e66b96019c (patch)
tree562127cc38e630882de1021103c7631b7eb606ad /cpp/test/ios/controller/Bundle
parentFix for ICE-8141 - increased the hold time and reduced the sequence size (diff)
downloadice-4b5aff6c604161e890234befc34a43e66b96019c.tar.bz2
ice-4b5aff6c604161e890234befc34a43e66b96019c.tar.xz
ice-4b5aff6c604161e890234befc34a43e66b96019c.zip
Fix for ICE-8140: the controller occasionally does not find dllTestShutdown
Diffstat (limited to 'cpp/test/ios/controller/Bundle')
-rw-r--r--cpp/test/ios/controller/Bundle/ControllerI.mm19
1 files changed, 16 insertions, 3 deletions
diff --git a/cpp/test/ios/controller/Bundle/ControllerI.mm b/cpp/test/ios/controller/Bundle/ControllerI.mm
index 309311b946d..538534a0d4f 100644
--- a/cpp/test/ios/controller/Bundle/ControllerI.mm
+++ b/cpp/test/ios/controller/Bundle/ControllerI.mm
@@ -193,10 +193,16 @@ MainHelperI::run()
return;
}
- // The following call is necessary to prevent random failures from CFBundleGetFunctionPointerForName
- dlsym(_handle, "dllTestShutdown");
+ //
+ // The first CFBundleGetFunction... does not always succeed, so we make up to 3 attempts
+ //
+ void* sym = 0;
+ int attempts = 0;
+ while((sym = CFBundleGetFunctionPointerForName(_handle, CFSTR("dllTestShutdown"))) == 0 && attempts < 3)
+ {
+ attempts++;
+ }
- void* sym = CFBundleGetFunctionPointerForName(_handle, CFSTR("dllTestShutdown"));
if(sym == 0)
{
NSString* err = [NSString stringWithFormat:@"Could not get function pointer dllTestShutdown from bundle %@",
@@ -205,6 +211,13 @@ MainHelperI::run()
completed(EXIT_FAILURE);
return;
}
+ /*
+ else
+ {
+ print([[NSString stringWithFormat:@"*** found dllTestShutdown after %d failed attempt(s)", attempts] UTF8String]);
+ }
+ */
+
_dllTestShutdown = (SHUTDOWN_ENTRY_POINT)sym;
sym = CFBundleGetFunctionPointerForName(_handle, CFSTR("dllMain"));