test(log): add pointer test cases

reviewable/pr1368/r2
Christian A. Jacobsen 4 weeks ago
parent bfca3fbe5e
commit 6bcd4f460b
No known key found for this signature in database

@ -89,6 +89,8 @@ fn test_log(ctx: ProbeContext) {
&ctx,
"{} {} {} {} {} {} {}", header, tmp, kind, value, size, op, buf
);
let ptr = 0xdeadbeef as *const u8;
debug!(&ctx, "ptr: {:p}, hex lc: {:x}, hex uc: {:X}", ptr, ptr, ptr);
// Testing compilation only.
if false {

@ -187,6 +187,15 @@ fn log() {
})
);
assert_eq!(
records.next(),
Some(&CapturedLog {
body: "ptr: deadbeef, hex lc: deadbeef, hex uc: DEADBEEF".into(),
level: Level::Debug,
target: "log".into(),
})
);
assert_eq!(
records.next(),
Some(&CapturedLog {

Loading…
Cancel
Save