summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-06-04 17:49:35 +0200
committerJose <jose@zeroc.com>2018-06-04 17:49:35 +0200
commit4bdff2cf010ecddfeda573c4bb1d4dc8efa60ee7 (patch)
tree9ac02041bd670e53f4f3f50fccafe1b0c3765b09
parentJavaScript Buffer.reset should set limit to the new capacity (diff)
downloadice-4bdff2cf010ecddfeda573c4bb1d4dc8efa60ee7.tar.bz2
ice-4bdff2cf010ecddfeda573c4bb1d4dc8efa60ee7.tar.xz
ice-4bdff2cf010ecddfeda573c4bb1d4dc8efa60ee7.zip
UWP test controller fixes
-rw-r--r--cpp/test/Common/TestHelper.cpp21
-rw-r--r--cpp/test/include/TestHelper.h9
-rw-r--r--cpp/test/uwp/controller/ControllerView.xaml.cpp4
3 files changed, 16 insertions, 18 deletions
diff --git a/cpp/test/Common/TestHelper.cpp b/cpp/test/Common/TestHelper.cpp
index 6208c83aa34..ef2f0e897b8 100644
--- a/cpp/test/Common/TestHelper.cpp
+++ b/cpp/test/Common/TestHelper.cpp
@@ -11,7 +11,6 @@ namespace
IceUtil::Mutex* globalMutex = 0;
Test::TestHelper* instance = 0;
-
#ifndef ICE_OS_UWP
IceUtil::CtrlCHandler* ctrlCHandler = 0;
#endif
@@ -45,6 +44,7 @@ Init init;
Test::TestHelper::TestHelper(bool registerPlugins)
{
+#if !defined(ICE_OS_UWP) && (!defined(__APPLE__) || TARGET_OS_IPHONE == 0)
{
IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(globalMutex);
if(instance != 0)
@@ -53,6 +53,7 @@ Test::TestHelper::TestHelper(bool registerPlugins)
}
instance = this;
}
+#endif
if(registerPlugins)
{
@@ -85,7 +86,7 @@ Test::TestHelper::~TestHelper()
}
void
-Test::TestHelper::setControllerHelper(const ControllerHelperPtr& controllerHelper)
+Test::TestHelper::setControllerHelper(ControllerHelper* controllerHelper)
{
assert(!_controllerHelper);
_controllerHelper = controllerHelper;
@@ -235,13 +236,6 @@ Test::TestHelper::serverReady()
}
void
-Test::TestHelper::completed()
-{
- IceUtil::Mutex::Lock lock(_mutex);
- _communicator = ICE_NULLPTR;
-}
-
-void
Test::TestHelper::shutdown()
{
IceUtil::Mutex::Lock lock(_mutex);
@@ -251,6 +245,12 @@ Test::TestHelper::shutdown()
}
}
+#if defined(ICE_OS_UWP) || (TARGET_OS_IPHONE != 0)
+void
+Test::TestHelper::shutdownOnInterrupt()
+{
+}
+#else
void
Test::TestHelper::shutdownOnInterruptCallback(int)
{
@@ -263,7 +263,6 @@ Test::TestHelper::shutdownOnInterruptCallback(int)
void
Test::TestHelper::shutdownOnInterrupt()
{
-#ifndef ICE_OS_UWP
{
IceUtilInternal::MutexPtrLock<IceUtil::Mutex> lock(globalMutex);
assert(!ctrlCHandler);
@@ -273,5 +272,5 @@ Test::TestHelper::shutdownOnInterrupt()
}
}
ctrlCHandler->setCallback(shutdownOnInterruptCallback);
-#endif
}
+#endif
diff --git a/cpp/test/include/TestHelper.h b/cpp/test/include/TestHelper.h
index 0c398ee2a79..0fe70986285 100644
--- a/cpp/test/include/TestHelper.h
+++ b/cpp/test/include/TestHelper.h
@@ -80,7 +80,7 @@ class StreamHelper : public std::streambuf
{
public:
- StreamHelper(ControllerHelperPtr controllerHelper, bool redirect) : _controllerHelper(controllerHelper)
+ StreamHelper(ControllerHelper* controllerHelper, bool redirect) : _controllerHelper(controllerHelper)
{
setp(&data[0], &data[sizeof(data) - 1]);
if(redirect)
@@ -146,7 +146,7 @@ private:
return std::streambuf::sputc(c);
}
- ControllerHelperPtr _controllerHelper;
+ ControllerHelper* _controllerHelper;
char data[1024];
Ice::LoggerPtr _previousLogger;
std::streambuf* _previousCoutBuffer;
@@ -161,7 +161,7 @@ public:
TestHelper(bool registerPlugins = true);
virtual ~TestHelper();
- void setControllerHelper(const ControllerHelperPtr&);
+ void setControllerHelper(ControllerHelper*);
std::string getTestEndpoint(const std::string&);
std::string getTestEndpoint(int num = 0, const std::string& prot = "");
@@ -187,7 +187,6 @@ public:
Ice::CommunicatorPtr communicator() const;
void serverReady();
- void completed();
void shutdown();
static void shutdownOnInterrupt();
@@ -197,7 +196,7 @@ public:
private:
- ControllerHelperPtr _controllerHelper;
+ ControllerHelper* _controllerHelper;
Ice::CommunicatorPtr _communicator;
IceUtil::Mutex _mutex;
};
diff --git a/cpp/test/uwp/controller/ControllerView.xaml.cpp b/cpp/test/uwp/controller/ControllerView.xaml.cpp
index 9ad8b372e85..cd356bc9d0d 100644
--- a/cpp/test/uwp/controller/ControllerView.xaml.cpp
+++ b/cpp/test/uwp/controller/ControllerView.xaml.cpp
@@ -199,9 +199,9 @@ ControllerHelperI::run()
argv[_args.size()] = 0;
try
{
- StreamHelper streamHelper(shared_from_this(), redirect());
+ StreamHelper streamHelper(this, redirect());
_helper.reset(createHelper());
- _helper->setControllerHelper(shared_from_this());
+ _helper->setControllerHelper(this);
_helper->run(static_cast<int>(_args.size()), argv);
completed(0);
}