summaryrefslogtreecommitdiff
path: root/t/unit-tests/t-reftable-basics.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-08 11:43:14 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-08 11:43:14 -0700
commit6e2a3b8ae0e07c0c31f2247fec49b77b5d903a83 (patch)
tree919b9fbd344616925501315ccaa79d5a7ca3ef50 /t/unit-tests/t-reftable-basics.c
parented7d9bd73f6f233da9e3b9cdbcb2ead1b889691d (diff)
parent8f6a2dbe34017e616f8bb35bc668538eb11a8d33 (diff)
Merge branch 'ps/reftable-sans-compat-util'
Make the code in reftable library less reliant on the service routines it used to borrow from Git proper, to make it easier to use by external users of the library. * ps/reftable-sans-compat-util: Makefile: skip reftable library for Coccinelle reftable: decouple from Git codebase by pulling in "compat/posix.h" git-compat-util.h: split out POSIX-emulating bits compat/mingw: split out POSIX-related bits reftable/basics: introduce `REFTABLE_UNUSED` annotation reftable/basics: stop using `SWAP()` macro reftable/stack: stop using `sleep_millisec()` reftable/system: introduce `reftable_rand()` reftable/reader: stop using `ARRAY_SIZE()` macro reftable/basics: provide wrappers for big endian conversion reftable/basics: stop using `st_mult()` in array allocators reftable: stop using `BUG()` in trivial cases reftable/record: don't `BUG()` in `reftable_record_cmp()` reftable/record: stop using `BUG()` in `reftable_record_init()` reftable/record: stop using `COPY_ARRAY()` reftable/blocksource: stop using `xmmap()` reftable/stack: stop using `write_in_full()` reftable/stack: stop using `read_in_full()`
Diffstat (limited to 't/unit-tests/t-reftable-basics.c')
-rw-r--r--t/unit-tests/t-reftable-basics.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/t/unit-tests/t-reftable-basics.c b/t/unit-tests/t-reftable-basics.c
index 9ba7eb05ad..c9e751e49e 100644
--- a/t/unit-tests/t-reftable-basics.c
+++ b/t/unit-tests/t-reftable-basics.c
@@ -128,12 +128,30 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
reftable_buf_release(&b);
}
- if_test ("put_be24 and get_be24 work") {
+ if_test ("reftable_put_be64 and reftable_get_be64 work") {
+ uint64_t in = 0x1122334455667788;
+ uint8_t dest[8];
+ uint64_t out;
+ reftable_put_be64(dest, in);
+ out = reftable_get_be64(dest);
+ check_int(in, ==, out);
+ }
+
+ if_test ("reftable_put_be32 and reftable_get_be32 work") {
+ uint32_t in = 0x11223344;
+ uint8_t dest[4];
+ uint32_t out;
+ reftable_put_be32(dest, in);
+ out = reftable_get_be32(dest);
+ check_int(in, ==, out);
+ }
+
+ if_test ("reftable_put_be24 and reftable_get_be24 work") {
uint32_t in = 0x112233;
uint8_t dest[3];
uint32_t out;
- put_be24(dest, in);
- out = get_be24(dest);
+ reftable_put_be24(dest, in);
+ out = reftable_get_be24(dest);
check_int(in, ==, out);
}
@@ -141,8 +159,8 @@ int cmd_main(int argc UNUSED, const char *argv[] UNUSED)
uint32_t in = 0xfef1;
uint8_t dest[3];
uint32_t out;
- put_be16(dest, in);
- out = get_be16(dest);
+ reftable_put_be16(dest, in);
+ out = reftable_get_be16(dest);
check_int(in, ==, out);
}