summaryrefslogtreecommitdiff
path: root/cpp/test/Ice/exceptions/AllTests.cpp
diff options
context:
space:
mode:
authorJoe George <joe@zeroc.com>2015-12-08 11:33:42 -0500
committerJoe George <joe@zeroc.com>2015-12-08 16:09:24 -0500
commit6a43686ce26de5d2d5edf4a485ecff3a242c26b6 (patch)
treed31e4f16dc9ed6e28056a7224e045a4638955f5e /cpp/test/Ice/exceptions/AllTests.cpp
parentC++11 mapping IceDiscovery plug-in (diff)
downloadice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.tar.bz2
ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.tar.xz
ice-6a43686ce26de5d2d5edf4a485ecff3a242c26b6.zip
ICE-6908 - Add ValueFactory
ValueFactory is a replacement for ObjectFactory (which is still available if needed). It is an interface with only one operation and can has the "delegate" metadata.
Diffstat (limited to 'cpp/test/Ice/exceptions/AllTests.cpp')
-rw-r--r--cpp/test/Ice/exceptions/AllTests.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/cpp/test/Ice/exceptions/AllTests.cpp b/cpp/test/Ice/exceptions/AllTests.cpp
index 562fb63a935..55eaa81147e 100644
--- a/cpp/test/Ice/exceptions/AllTests.cpp
+++ b/cpp/test/Ice/exceptions/AllTests.cpp
@@ -39,12 +39,13 @@ public:
#endif
};
-class ObjectFactoryI : virtual public Ice::ObjectFactory
+#ifndef ICE_CPP11_MAPPING // C++98
+class ValueFactoryI : virtual public Ice::ValueFactory
{
public:
virtual Ice::ObjectPtr create(const string&) { return 0; }
- virtual void destroy() {}
};
+#endif
class CallbackBase : public IceUtil::Monitor<IceUtil::Mutex>
{
@@ -634,10 +635,10 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
cout << "ok" << endl;
- cout << "testing object factory registration exception... " << flush;
+ cout << "testing value factory registration exception... " << flush;
{
#ifdef ICE_CPP11_MAPPING
- communicator->addObjectFactory(
+ communicator->addValueFactory(
[](const std::string&)
{
return nullptr;
@@ -645,7 +646,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
"x");
try
{
- communicator->addObjectFactory(
+ communicator->addValueFactory(
[](const std::string&)
{
return nullptr;
@@ -657,11 +658,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
{
}
#else
- Ice::ObjectFactoryPtr of = new ObjectFactoryI;
- communicator->addObjectFactory(of, "x");
+ Ice::ValueFactoryPtr vf = new ValueFactoryI;
+ communicator->addValueFactory(vf, "x");
try
{
- communicator->addObjectFactory(of, "x");
+ communicator->addValueFactory(vf, "x");
test(false);
}
catch(const Ice::AlreadyRegisteredException&)