summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/Proxy.h6
-rw-r--r--cpp/test/Ice/invoke/AllTests.cpp23
2 files changed, 25 insertions, 4 deletions
diff --git a/cpp/include/Ice/Proxy.h b/cpp/include/Ice/Proxy.h
index cc951c7b614..75ca5aa9b5a 100644
--- a/cpp/include/Ice/Proxy.h
+++ b/cpp/include/Ice/Proxy.h
@@ -187,7 +187,7 @@ public:
{
if(this->_is.b.empty())
{
- response(R { ok, { 0, 0 }});
+ response(R { ok, { static_cast<Ice::Byte*>(nullptr), static_cast<Ice::Byte*>(nullptr) } });
}
else
{
@@ -211,7 +211,7 @@ public:
{
if(this->_is.b.empty())
{
- this->_promise.set_value(R { ok, { 0, 0 }});
+ this->_promise.set_value(R { ok, { static_cast<Ice::Byte*>(nullptr), static_cast<Ice::Byte*>(nullptr) } });
}
else
{
@@ -224,7 +224,7 @@ public:
{
if(done)
{
- this->_promise.set_value(R { true, { 0, 0 }});
+ this->_promise.set_value(R { true, { static_cast<Ice::Byte*>(nullptr), static_cast<Ice::Byte*>(nullptr) } });
}
return false;
}
diff --git a/cpp/test/Ice/invoke/AllTests.cpp b/cpp/test/Ice/invoke/AllTests.cpp
index 66058b20230..d615ffb37a8 100644
--- a/cpp/test/Ice/invoke/AllTests.cpp
+++ b/cpp/test/Ice/invoke/AllTests.cpp
@@ -380,6 +380,14 @@ allTests(Test::TestHelper* helper)
}
}
+ {
+ // Oneway operation with a oneway proxy must return empty encapsulation.
+ Ice::ByteSeq inEncaps, outEncaps;
+ bool returnValue = oneway->ice_invoke("opOneway", Ice::ICE_ENUM(OperationMode, Normal), inEncaps, outEncaps);
+ test(returnValue);
+ test(outEncaps.size() == 0); // Empty encapsulation
+ }
+
cout << "ok" << endl;
cout << "testing asynchronous ice_invoke... " << flush;
@@ -439,9 +447,20 @@ allTests(Test::TestHelper* helper)
//
{
+ // Oneway operation with a oneway proxy must return empty encapsulation.
Ice::ByteSeq inEncaps, outEncaps;
+ bool returnValue = oneway->ice_invoke("opOneway", Ice::OperationMode::Normal, inEncaps, outEncaps);
+ test(returnValue);
+ test(outEncaps.size() == 0); // Empty encapsulation
+ }
+
+ {
+ // Oneway operation with a oneway proxy must return empty encapsulation.
+ Ice::ByteSeq inEncaps;
auto completed = oneway->ice_invokeAsync("opOneway", Ice::OperationMode::Normal, inEncaps);
- test(completed.get().returnValue);
+ auto result = completed.get();
+ test(result.returnValue);
+ test(result.outParams.size() == 0); // Empty encapsulation
}
{
@@ -646,6 +665,8 @@ allTests(Test::TestHelper* helper)
{
test(false);
}
+ test(result);
+ test(outEncaps.size() == 0); // Empty encapsulation
Ice::OutputStream out(communicator);
out.startEncapsulation();