-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Debug impls #189
Improve Debug impls #189
Conversation
Codecov Report
@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 30.76% 30.86% +0.10%
==========================================
Files 16 16
Lines 4018 4004 -14
==========================================
Hits 1236 1236
+ Misses 2782 2768 -14
Continue to review full report at Codecov.
|
Personal, I like my fmt::Debug implementation. I like to read hexadecimal numbers... |
Fair enough! The derived impl supports that as well for the whole struct using |
@mkroening's approach is pretty elegant though. Can you maybe post a quick example output of |
Sure! Current output of magic_number 0xc0decafe
version 0x1
base 0x0
limit 0x0
tls_start 0x0
tls_filesz 0x0
tls_memsz 0x0
image_size 0x0
current_stack_address 0x0
current_percore_address 0x0
host_logical_addr 0x0
boot_gtod 0x0
mb_info 0x0
cmdline 0x0
cmdsize 0x0
cpu_freq 0
boot_processor 4294967295
cpu_online 0
possible_cpus 0
current_boot_id 0
uartport 0x0
single_kernel 1
uhyve 0
New output of BootInfo { magic_number: 3235826430, version: 1, base: 0, limit: 0, image_size: 0, tls_start: 0, tls_filesz: 0, tls_memsz: 0, current_stack_address: 0, current_percore_address: 0, host_logical_addr: 0, boot_gtod: 0, mb_info: 0, cmdline: 0, cmdsize: 0, cpu_freq: 0, boot_processor: 4294967295, cpu_online: 0, possible_cpus: 0, current_boot_id: 0, uartport: 0, single_kernel: 1, uhyve: 0, hcip: [255, 255, 255, 255], hcgateway: [255, 255, 255, 255], hcmask: [255, 255, 255, 0] } New output of BootInfo {
magic_number: 0xc0decafe,
version: 0x1,
base: 0x0,
limit: 0x0,
image_size: 0x0,
tls_start: 0x0,
tls_filesz: 0x0,
tls_memsz: 0x0,
current_stack_address: 0x0,
current_percore_address: 0x0,
host_logical_addr: 0x0,
boot_gtod: 0x0,
mb_info: 0x0,
cmdline: 0x0,
cmdsize: 0x0,
cpu_freq: 0x0,
boot_processor: 0xffffffff,
cpu_online: 0x0,
possible_cpus: 0x0,
current_boot_id: 0x0,
uartport: 0x0,
single_kernel: 0x1,
uhyve: 0x0,
hcip: [
0xff,
0xff,
0xff,
0xff,
],
hcgateway: [
0xff,
0xff,
0xff,
0xff,
],
hcmask: [
0xff,
0xff,
0xff,
0x0,
],
} |
This is Ok for me. |
bors r=stlankes |
192: mem_size tests: Assert exact error r=jounathaen a=mkroening Depends on #189 but is ready for review. This ensures, that the intended error variant is returned. Co-authored-by: Martin Kröning <[email protected]>
No description provided.