summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2009-11-26 22:58:16 +0100
committerJose <jose@zeroc.com>2009-11-26 22:58:16 +0100
commit9aef7822702155a4bd562765c672d73dcbe8b471 (patch)
tree984b00a3fea5615b594e3e857eadceeb5766283c /cpp/test
parentAdded generated directory for invoke test (diff)
downloadice-9aef7822702155a4bd562765c672d73dcbe8b471.tar.bz2
ice-9aef7822702155a4bd562765c672d73dcbe8b471.tar.xz
ice-9aef7822702155a4bd562765c672d73dcbe8b471.zip
4385 - new StreamApi & UserExecption
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Ice/stream/Client.cpp79
-rw-r--r--cpp/test/Ice/stream/Test.ice23
2 files changed, 102 insertions, 0 deletions
diff --git a/cpp/test/Ice/stream/Client.cpp b/cpp/test/Ice/stream/Client.cpp
index 3e0e5f6b663..6b0c7cd1d7e 100644
--- a/cpp/test/Ice/stream/Client.cpp
+++ b/cpp/test/Ice/stream/Client.cpp
@@ -584,6 +584,85 @@ run(int argc, char** argv, const Ice::CommunicatorPtr& communicator)
test(reader->obj);
test(reader->obj->s.e == Test::enum2);
}
+
+ {
+ out = Ice::createOutputStream(communicator);
+ Test::MyException ex;
+ Test::MyClassForExceptionPtr c = new Test::MyClassForException;
+ c->c = c;
+ c->o = c;
+ c->s.e = Test::enum2;
+
+ c->seq1.push_back(true);
+ c->seq1.push_back(false);
+ c->seq1.push_back(true);
+ c->seq1.push_back(false);
+
+ c->seq2.push_back(1);
+ c->seq2.push_back(2);
+ c->seq2.push_back(3);
+ c->seq2.push_back(4);
+
+ c->seq3.push_back(1);
+ c->seq3.push_back(2);
+ c->seq3.push_back(3);
+ c->seq3.push_back(4);
+
+ c->seq4.push_back(1);
+ c->seq4.push_back(2);
+ c->seq4.push_back(3);
+ c->seq4.push_back(4);
+
+ c->seq5.push_back(1);
+ c->seq5.push_back(2);
+ c->seq5.push_back(3);
+ c->seq5.push_back(4);
+
+ c->seq6.push_back(1);
+ c->seq6.push_back(2);
+ c->seq6.push_back(3);
+ c->seq6.push_back(4);
+
+ c->seq7.push_back(1);
+ c->seq7.push_back(2);
+ c->seq7.push_back(3);
+ c->seq7.push_back(4);
+
+ c->seq8.push_back("string1");
+ c->seq8.push_back("string2");
+ c->seq8.push_back("string3");
+ c->seq8.push_back("string4");
+
+ c->seq9.push_back(Test::enum3);
+ c->seq9.push_back(Test::enum2);
+ c->seq9.push_back(Test::enum1);
+
+ ex.c = c;
+
+ out->write(ex);
+ out->writePendingObjects();
+ out->finished(data);
+
+ in = Ice::createInputStream(communicator, data);
+ try
+ {
+ in->throwException();
+ test(false);
+ }
+ catch(const Test::MyException& ex1)
+ {
+ test(ex1.c->s.e == c->s.e);
+ test(ex1.c->seq1 == c->seq1);
+ test(ex1.c->seq2 == c->seq2);
+ test(ex1.c->seq3 == c->seq3);
+ test(ex1.c->seq4 == c->seq4);
+ test(ex1.c->seq5 == c->seq5);
+ test(ex1.c->seq6 == c->seq6);
+ test(ex1.c->seq7 == c->seq7);
+ test(ex1.c->seq8 == c->seq8);
+ test(ex1.c->seq9 == c->seq9);
+ }
+ }
cout << "ok" << endl;
diff --git a/cpp/test/Ice/stream/Test.ice b/cpp/test/Ice/stream/Test.ice
index dafd2f02d41..6f7d4be6551 100644
--- a/cpp/test/Ice/stream/Test.ice
+++ b/cpp/test/Ice/stream/Test.ice
@@ -86,6 +86,29 @@ interface MyInterface
{
};
+class MyClassForException
+{
+ MyClassForException c;
+ Object o;
+ SmallStruct s;
+ BoolS seq1;
+ ByteS seq2;
+ ShortS seq3;
+ IntS seq4;
+ LongS seq5;
+ FloatS seq6;
+ DoubleS seq7;
+ StringS seq8;
+ MyEnumS seq9;
+};
+
+
+
+exception MyException
+{
+ MyClassForException c;
+};
+
};
#endif