Skip to content

Commit a47674f

Browse files
authored
Merge pull request #41 from zonyitoo/big-endian-fix
Combine oid counter generation tests
2 parents 70699c3 + 056c34a commit a47674f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/oid.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,11 @@ fn pid_generation() {
306306
}
307307

308308
#[test]
309-
fn count_generation() {
310-
let start = 52222;
309+
fn count_generated_is_big_endian() {
310+
let start = 1122866;
311311
OID_COUNTER.store(start, Ordering::SeqCst);
312+
313+
// Test count generates correct value 1122866
312314
let count_res = ObjectId::gen_count();
313315
assert!(count_res.is_ok());
314316
let count_bytes = count_res.unwrap();
@@ -320,12 +322,8 @@ fn count_generation() {
320322

321323
let count = BigEndian::read_u32(&buf);
322324
assert_eq!(start as u32, count);
323-
}
324325

325-
#[test]
326-
fn count_is_big_endian() {
327-
let start = 1122867;
328-
OID_COUNTER.store(start, Ordering::SeqCst);
326+
// Test OID formats count correctly as big endian
329327
let oid_res = ObjectId::new();
330328
assert!(oid_res.is_ok());
331329
let oid = oid_res.unwrap();

0 commit comments

Comments
 (0)