diff options
| author | Mattias Andrée <m@maandree.se> | 2026-01-21 16:54:08 +0100 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-01-21 16:54:08 +0100 |
| commit | b282c2ae432841c882e6d4c9eec48f9d359e1364 (patch) | |
| tree | 888dc29df75f7e3f0a4204863fea68b1d8e2f4fd /libj2_j2u_to_j2i.c | |
| parent | Add some man pages (diff) | |
| download | libj2-b282c2ae432841c882e6d4c9eec48f9d359e1364.tar.gz libj2-b282c2ae432841c882e6d4c9eec48f9d359e1364.tar.bz2 libj2-b282c2ae432841c882e6d4c9eec48f9d359e1364.tar.xz | |
Document and add test for the result of converting between unsigned and negative
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libj2_j2u_to_j2i.c')
| -rw-r--r-- | libj2_j2u_to_j2i.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libj2_j2u_to_j2i.c b/libj2_j2u_to_j2i.c index eb5b404..f157b79 100644 --- a/libj2_j2u_to_j2i.c +++ b/libj2_j2u_to_j2i.c @@ -74,6 +74,15 @@ main(void) EXPECT(u.low == b); } + v = (struct libj2_j2i){111, 222}; + u.high = a = 100; + u.low = b = 200; + libj2_j2u_rsub_ju(&u, 0); + libj2_j2u_to_j2i(&u, &v); + libj2_minus_j2i(&v); + EXPECT(v.high == a); + EXPECT(v.low == b); + return 0; } |
