blob: 0d03b401cf651c91900292e2105ef2cb68d7759d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifndef TEST
extern inline int libj2_j2u_test_high_ju(const struct libj2_j2u *a, uintmax_t b);
/* TODO Add man page */
#else
int
main(void)
{
struct libj2_j2u a;
uintmax_t h, i, j;
for (h = 0; h < 10; h++) {
a.low = h;
for (i = 0; i < 128; i++) {
for (j = 0; j < 128; j++) {
a.high = i;
if (i & j)
EXPECT(libj2_j2u_test_high_ju(&a, j) == 1);
else
EXPECT(libj2_j2u_test_high_ju(&a, j) == 0);
EXPECT(a.low == h);
EXPECT(a.high == i);
}
}
}
return 0;
}
#endif
|