From b282c2ae432841c882e6d4c9eec48f9d359e1364 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 21 Jan 2026 16:54:08 +0100 Subject: Document and add test for the result of converting between unsigned and negative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libj2_j2i_to_j2u.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libj2_j2i_to_j2u.c') diff --git a/libj2_j2i_to_j2u.c b/libj2_j2i_to_j2u.c index 4419c7a..b81c394 100644 --- a/libj2_j2i_to_j2u.c +++ b/libj2_j2i_to_j2u.c @@ -70,6 +70,15 @@ main(void) EXPECT(u.low == b); } + u = (struct libj2_j2u){111, 222}; + v.high = a = 100; + v.low = b = 200; + libj2_minus_j2i(&v); + libj2_j2i_to_j2u(&v, &u); + libj2_j2u_rsub_ju(&u, 0); + EXPECT(u.high == a); + EXPECT(u.low == b); + return 0; } -- cgit v1.2.3-70-g09d2