summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2007-09-19 11:22:45 +1000
committerMichi Henning <michi@zeroc.com>2007-09-19 11:22:45 +1000
commitcd0338e842b7751c423f5384d247202d3c981be4 (patch)
tree2b2965f974c3f7f0dda3b94ed4d7c1c49175d375 /cpp/test
parentAdded more tests. Changed stack marshaling to reverse order during (diff)
parentAdded missing facet (diff)
downloadice-cd0338e842b7751c423f5384d247202d3c981be4.tar.bz2
ice-cd0338e842b7751c423f5384d247202d3c981be4.tar.xz
ice-cd0338e842b7751c423f5384d247202d3c981be4.zip
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Conflicts: cs/src/Ice/Instance.cs Removed conflicts. Added more tests. Changed stack marshaling to reverse order during marshaling instead of during unmarshaling.
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Freeze/dbmap/Client.cpp48
-rw-r--r--cpp/test/Glacier2/router/Client.cpp26
-rwxr-xr-xcpp/test/Glacier2/router/run.py3
3 files changed, 59 insertions, 18 deletions
diff --git a/cpp/test/Freeze/dbmap/Client.cpp b/cpp/test/Freeze/dbmap/Client.cpp
index 17af3c7120b..4d602cb39f4 100644
--- a/cpp/test/Freeze/dbmap/Client.cpp
+++ b/cpp/test/Freeze/dbmap/Client.cpp
@@ -851,6 +851,54 @@ main(int argc, char* argv[])
status = EXIT_FAILURE;
}
+
+ cout << "testing manual code... " << flush;
+
+ //
+ // From manual
+ //
+
+ Freeze::ConnectionPtr connection =
+ Freeze::createConnection(communicator, envName);
+
+ // Instantiate the map.
+ //
+ ByteIntMap map(connection, "simple");
+
+ // Clear the map.
+ //
+ map.clear();
+
+ Ice::Int i;
+ ByteIntMap::iterator p;
+
+ // Populate the map.
+ //
+ for (i = 0; i < 26; i++)
+ {
+ Ice::Byte key = static_cast<Ice::Byte>('a' + i);
+ map.insert(make_pair(key, i));
+ }
+
+ // Iterate over the map and change the values.
+ //
+ for (p = map.begin(); p != map.end(); ++p)
+ {
+ p.set(p->second + 1);
+ }
+
+ // Find and erase the last element.
+ //
+ p = map.find(static_cast<Ice::Byte>('z'));
+ assert(p != map.end());
+ map.erase(p);
+
+ // Clean up.
+ //
+ connection->close();
+
+ cout << "ok" << endl;
+
try
{
communicator->destroy();
diff --git a/cpp/test/Glacier2/router/Client.cpp b/cpp/test/Glacier2/router/Client.cpp
index 686752a79d1..65717e620cc 100644
--- a/cpp/test/Glacier2/router/Client.cpp
+++ b/cpp/test/Glacier2/router/Client.cpp
@@ -862,36 +862,28 @@ CallbackClient::run(int argc, char* argv[])
cout << "ok" << endl;
}
- ObjectPrx adminBase;
+ ObjectPrx processBase;
{
- cout << "testing stringToProxy for admin object... " << flush;
- adminBase = communicator()->stringToProxy("Glacier2/admin:tcp -h 127.0.0.1 -p 12348 -t 10000");
+ cout << "testing stringToProxy for admin process facet... " << flush;
+ processBase = communicator()->stringToProxy("Glacier2/admin -f Process:tcp -h 127.0.0.1 -p 12348 -t 10000");
cout << "ok" << endl;
}
-/*
- {
- cout << "uninstalling router with admin object... " << flush;
- adminBase->ice_router(0);
- cout << "ok" << endl;
- }
-*/
-
- Glacier2::AdminPrx admin;
+ Ice::ProcessPrx process;
{
- cout << "testing checked cast for admin object... " << flush;
- admin = Glacier2::AdminPrx::checkedCast(adminBase);
- test(admin);
+ cout << "testing checked cast for process facet... " << flush;
+ process = Ice::ProcessPrx::checkedCast(processBase);
+ test(process);
cout << "ok" << endl;
}
cout << "testing Glacier2 shutdown... " << flush;
- admin->shutdown();
+ process->shutdown();
try
{
- admin->ice_ping();
+ process->ice_ping();
test(false);
}
catch(const Ice::LocalException&)
diff --git a/cpp/test/Glacier2/router/run.py b/cpp/test/Glacier2/router/run.py
index b54ebe0c3c4..a7106d66159 100755
--- a/cpp/test/Glacier2/router/run.py
+++ b/cpp/test/Glacier2/router/run.py
@@ -30,7 +30,8 @@ command = router + TestUtil.clientServerOptions + \
r' --Glacier2.SessionTimeout="30"' + \
r' --Glacier2.Client.Endpoints="default -p 12347 -t 10000"' + \
r' --Glacier2.Server.Endpoints="tcp -h 127.0.0.1 -t 10000"' \
- r' --Glacier2.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \
+ r' --Ice.Admin.Endpoints="tcp -h 127.0.0.1 -p 12348 -t 10000"' + \
+ r' --Ice.Admin.InstanceName="Glacier2"' + \
r' --Glacier2.CryptPasswords="' + toplevel + r'/test/Glacier2/router/passwords"'
print "starting router...",