diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-02-19 22:42:23 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-02-19 22:42:23 +0000 |
commit | f24d7abc472c9cb85af7fa00271f3434d01c1ffa (patch) | |
tree | da39338e1f9e96f0d7b3f0bbf65e4d3a306d0f90 /cpp/test/Freeze/dbmap/Client.cpp | |
parent | clarification (diff) | |
download | ice-f24d7abc472c9cb85af7fa00271f3434d01c1ffa.tar.bz2 ice-f24d7abc472c9cb85af7fa00271f3434d01c1ffa.tar.xz ice-f24d7abc472c9cb85af7fa00271f3434d01c1ffa.zip |
adding operator[] to Freeze map
Diffstat (limited to 'cpp/test/Freeze/dbmap/Client.cpp')
-rw-r--r-- | cpp/test/Freeze/dbmap/Client.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/test/Freeze/dbmap/Client.cpp b/cpp/test/Freeze/dbmap/Client.cpp index aca2d3a08ee..be4f3b6d3a6 100644 --- a/cpp/test/Freeze/dbmap/Client.cpp +++ b/cpp/test/Freeze/dbmap/Client.cpp @@ -52,7 +52,7 @@ populateDB(MAP& m) for(vector<Byte>::const_iterator j = alphabet.begin(); j != alphabet.end(); ++j) { - m.insert(make_pair(*j, j-alphabet.begin())); + m[*j] = j - alphabet.begin(); } } @@ -115,6 +115,13 @@ run(int argc, char* argv[], MAP& m) test(cp != m.end()); test(cp->first == *j && cp->second == j - alphabet.begin()); } + // + // Finally try operator[] + // + for(j = alphabet.begin(); j != alphabet.end(); ++j) + { + test(m[*j] == j - alphabet.begin()); + } test(!m.empty()); test(m.size() == alphabet.size()); |