[hydra-commits] beagles: branch ice/preserve-graphs r625 - /ice/branches/preserve-graphs/cpp/...
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Wed May 19 09:07:18 CDT 2010
Author: beagles
Date: Wed May 19 09:07:18 2010
New Revision: 625
URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=625
Log:
added a slightly more complex test for object graphs
Modified:
ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/AllTests.cpp
ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/ClientPrivate.ice
Modified: ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/AllTests.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/AllTests.cpp?view=diff&rev=625&r1=624&r2=625
==============================================================================
--- ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/AllTests.cpp (original)
+++ ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/AllTests.cpp Wed May 19 09:07:18 2010
@@ -1484,6 +1484,64 @@
}
}
cout << "ok" << endl;
+
+ //
+ // TODO: some more complex tests.
+ //
+ cout << "object graphs of unsliceable objects... " << flush;
+ {
+ try
+ {
+ GraphBasePtr graph = new GraphBase;
+ D6Ptr d6 = new D6;
+ d6->sd6 = "d6.1";
+ d6->innerD5 = new D5;
+ d6->innerD5->sd5 = "d6.1.d5";
+ d6->innerD5->pd5 = new B;
+ d6->innerD5->pd5->sb = "d6.1.d5.sb";
+ d6->innerD5->pd5->pb = new B;
+ d6->innerD5->pd5->pb->sb = "d6.1.d5.sb.sb";
+ graph->left = d6;
+
+ D7Ptr d7 = new D7;
+ d7->sd7 = "d7";
+ d7->innerD7 = new D7;
+ d7->innerD7->sd7 = "d7.d7";
+ d7->innerD7->innerD7 = new D7;
+ d7->innerD7->innerD7->sd7 = "d7.d7.d7";
+ graph->right = d7;
+
+ BPtr result = test->returnTest3(graph, d7);
+ test(result);
+ GraphBasePtr t = GraphBasePtr::dynamicCast(result);
+ test(t);
+ D6Ptr t6 = D6Ptr::dynamicCast(t->left);
+ test(t6);
+ test(t6->sd6 == "d6.1");
+ test(t6->innerD5);
+ test(t6->innerD5->sd5 == "d6.1.d5");
+ test(t6->innerD5->pd5);
+ test(t6->innerD5->pd5->sb == "d6.1.d5.sb");
+ test(t6->innerD5->pd5->pb);
+ test(t6->innerD5->pd5->pb->sb == "d6.1.d5.sb.sb");
+
+ D7Ptr t7 = D7Ptr::dynamicCast(t->right);
+ test(t7);
+ test(t7->sd7 == "d7");
+ test(t7->innerD7);
+ test(t7->innerD7->sd7 == "d7.d7");
+ test(t7->innerD7->innerD7);
+ test(t7->innerD7->innerD7->sd7 == "d7.d7.d7");
+
+ }
+ catch(const Ice::Exception& ex)
+ {
+ std::cerr << ex << std::endl;
+ test(false);
+ }
+ }
+ cout << "ok" << endl;
+
cout << "slice preserved object, unknown inner class... " << flush;
{
Modified: ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/ClientPrivate.ice
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/ClientPrivate.ice?view=diff&rev=625&r1=624&r2=625
==============================================================================
--- ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/ClientPrivate.ice (original)
+++ ice/branches/preserve-graphs/cpp/test/Ice/slicing/objects/ClientPrivate.ice Wed May 19 09:07:18 2010
@@ -27,6 +27,12 @@
B pd5;
};
+class GraphBase extends BU
+{
+ BU left;
+ BU right;
+};
+
class D6 extends BU
{
string sd6;
More information about the asterisk-scf-commits
mailing list