MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / incr_overflow

Function incr_overflow

nodedb/src/engine/kv/engine_atomic.rs:505–512  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

503
504 #[test]
505 fn incr_overflow() {
506 let mut engine = make_engine();
507 // Set to MAX.
508 let bytes = zerompk::to_msgpack_vec(&i64::MAX).unwrap();
509 engine.put(1, "counters", b"max", &bytes, 0, 1000, Surrogate::ZERO);
510 let result = engine.incr(1, "counters", b"max", 1, 0, 1000);
511 assert!(matches!(result, Err(AtomicError::Overflow)));
512 }
513
514 #[test]
515 fn incr_type_mismatch() {

Callers

nothing calls this directly

Calls 3

incrMethod · 0.80
make_engineFunction · 0.70
putMethod · 0.45

Tested by

no test coverage detected