28 lines
675 B
C
28 lines
675 B
C
#include <stdio.h>
|
|
#include <ucore/ucore_seq.h>
|
|
|
|
|
|
void check_before(uint32_t a, uint32_t b)
|
|
{
|
|
printf("%lu before %lu = %d\n", a ,b, seq_before(a, b));
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
check_before(0, 1);
|
|
check_before(1, 0);
|
|
check_before(0, 0xffffffff);
|
|
check_before(0, 0xffff);
|
|
check_before(0, 0x1ffff);
|
|
check_before(0xffff, 0xffffffff);
|
|
check_before(0x7fffffffU - 1, 0xffffffff);
|
|
check_before(0x7fffffffU + 1, 0xffffffff);
|
|
check_before(0x7fffffffU + 1, 0x7fffffffU);
|
|
check_before(0x7fffffffU - 1, 0x7fffffffU);
|
|
check_before(0x7fffffffU, 0x7fffffffU - 1);
|
|
check_before(0x7fffffffU, 0x7fffffffU + 1);
|
|
|
|
|
|
return 1;
|
|
}
|