GH #440 changed default string format

This commit is contained in:
Alex Fabijanic 2014-05-08 21:48:41 -05:00
parent 556d8cf1c4
commit c1eb293261
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ public:
Timestamp timestamp() const;
/// Returns the timestamp which is stored in the first four bytes of the id
std::string toString(const std::string& fmt = "%x") const;
std::string toString(const std::string& fmt = "%02x") const;
/// Returns the id in string format. The fmt parameter
/// specifies the formatting used for individual members
/// of the ID char array.

View File

@ -417,7 +417,7 @@ void MongoDBTest::testObjectID()
str.append(1, (char) 0x02);
ObjectId oid(str);
std::string str2 = oid.toString("%02x");
std::string str2 = oid.toString();
assert(str2 == "536aeebba081de6815000002");
}