diff options
author | dwight <dwight@10gen.com> | 2010-12-30 23:17:23 -0500 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2010-12-30 23:17:23 -0500 |
commit | b0f1ce87ffcb8acc2e9b67b428ce8dc359648528 (patch) | |
tree | 9ec92b018908a699e08b647bf699cf6fb9248620 /bson | |
parent | 411274ae4210d20e98640035f86188bfd559fb12 (diff) | |
download | mongo-b0f1ce87ffcb8acc2e9b67b428ce8dc359648528.tar.gz |
additional test
Diffstat (limited to 'bson')
-rw-r--r-- | bson/oid.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bson/oid.cpp b/bson/oid.cpp index 3d4a6876415..048f60419f0 100644 --- a/bson/oid.cpp +++ b/bson/oid.cpp @@ -49,6 +49,16 @@ namespace mongo { } static OID::MachineAndPid __gen() { + // this is not called often, so the following is not expensive, and gives us some + // testing that nonce generation is working right and that our OIDs are (perhaps) ok. + { + nonce a = security.getNonce(); + nonce b = security.getNonce(); + nonce c = security.getNonce(); + nonce d = security.getNonce(); + assert( !(a == b == c == d) ); + } + unsigned long long n = security.getNonce(); OID::MachineAndPid x = ourMachine = (OID::MachineAndPid&) n; foldInPid(x); |