code wiki / (root) / nx_toner_ledger_test.nx

nx_toner_ledger_test.nx

buildroot/runtime/nx_toner_ledger_test.nx

1886 B41 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic toner
docsdependenciesstructsconstsfunctions

about

nx_toner_ledger_test.nx -- gate for real toner accounting. Unique exit codes per invariant: 1x capacity: TN-630 = 1200*50000 = 60,000,000 ; TN-660 = 130,000,000 2x fresh cartridge (consumed 0) -> 10000 bp (100.00%), 1200 pages left 3x one ISO 5% page (50,000) -> 9991 bp, 1199 pages left, used 1 page 4x half consumed (30,000,000) -> 5000 bp (50.00%), 600 pages left 5x over-consumed clamp -> 0 bp, 0 pages 6x add accumulates expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_toner_ledger.nx nx_toner_ledger_test.nx

imports: nx_syscalls.nxnx_toner_ledger.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_ledger_capacity nx_ledger_remaining_bp nx_ledger_capacity ↻ nx_ledger_remaining_pages nx_ledger_capacity ↻ nx_ledger_used_pages nx_ledger_add t_puts sys_write

structs

none

consts

none

functions

13func t_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
15func main() -> i64