diff options
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 19 |
1 files changed, 6 insertions, 13 deletions
@@ -53,18 +53,9 @@ int main(void) { } // math { - unsigned int const val = zap_absi(zap_minvali); - test(val,(unsigned int)zap_maxvali + 0x1u,==) - } - { - zap_quotremi const quotrem = zap_divmodi(0x45,0x5); - test(quotrem.quot,0xD,==) - test(quotrem.rem, 0x4,==) - } - { - test(zap_divmodl(0x10000,zap_expsc(0x3,0x3)).quot,0x97B,==) /* 3^(-3) */ - test(zap_expsc(0x0,0x0),0x1,==) - test(zap_expsc(0x0,0x1),0x0,==) + zap_pairi const pair = zap_divmodi(0x45,0x5); + test(pair.lval,0xD,==) + test(pair.rval, 0x4,==) } // mem { @@ -78,7 +69,9 @@ int main(void) { 0xE3u,0xE5u,0xE9u,0xEFu,0xF1u,0xFBu, }; zap_i8 dest[sizeof (src)]; - test(zap_cp(dest,src,sizeof (src)),dest + sizeof(src),==) + zap_cpret const cpret = zap_cp(dest,src,sizeof (src)); + test(cpret.dest,dest + sizeof(src),==) + test(cpret.src,src + sizeof(src),==) test(dest[0x00u],0x02u,==) test(dest[0x01u],0x03u,==) test(dest[0x02u],0x05u,==) |