diff options
author | Michi Henning <michi@zeroc.com> | 2007-09-19 11:22:45 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2007-09-19 11:22:45 +1000 |
commit | cd0338e842b7751c423f5384d247202d3c981be4 (patch) | |
tree | 2b2965f974c3f7f0dda3b94ed4d7c1c49175d375 /cpp/test/Freeze/dbmap/Client.cpp | |
parent | Added more tests. Changed stack marshaling to reverse order during (diff) | |
parent | Added missing facet (diff) | |
download | ice-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/Freeze/dbmap/Client.cpp')
-rw-r--r-- | cpp/test/Freeze/dbmap/Client.cpp | 48 |
1 files changed, 48 insertions, 0 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(); |