summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2023-08-25 17:52:59 -0400
committerTom Rini <[email protected]>2023-08-25 17:52:59 -0400
commit05763b71d2fcfe9729bf5ef0b14bd00c3af0c985 (patch)
tree8a62bb1cda41f5fb2ff2cb0211e927e45645e18a /test/lib
parent7c6b18fb5494a1da2421b16c42d31fc466c38362 (diff)
parent84b08afcbb8f8b4402b940d87bf5822984eedb3d (diff)
Merge branch '2023-08-25-add-persistent-config-editor-via-expo' into next
To quote the author: So far cedit does not support reading and writing the configuration. This series add several features related to this: First, it adds support for using a file on a filesystem. This is in FDT format and provides enough information to reset the cedit back to the saved settings. Second, it adds support for using the U-Boot environment. Since the environment is generally saved across reboots, this feature provides an easy way of storing the state on most boards. The variables all have a 'c.' prefix to avoid confusion with other variables. Finally it adds support for using CMOS RAM. This is commonly used on x86 devices to store BIOS settings. The expo schema provides information on the register layout. Some other minor tweaks and improvements are included along the way.
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/abuf.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/lib/abuf.c b/test/lib/abuf.c
index 42ee4c17552..42803b20e2a 100644
--- a/test/lib/abuf.c
+++ b/test/lib/abuf.c
@@ -155,6 +155,31 @@ static int lib_test_abuf_realloc_size(struct unit_test_state *uts)
}
LIB_TEST(lib_test_abuf_realloc_size, 0);
+/* Test abuf_realloc_inc() */
+static int lib_test_abuf_realloc_inc(struct unit_test_state *uts)
+{
+ struct abuf buf;
+ ulong start;
+
+ start = ut_check_free();
+
+ abuf_init(&buf);
+ ut_asserteq(0, buf.size);
+ ut_asserteq(false, buf.alloced);
+
+ abuf_realloc_inc(&buf, 20);
+ ut_asserteq(20, buf.size);
+ ut_asserteq(true, buf.alloced);
+
+ abuf_uninit(&buf);
+
+ /* Check for memory leaks */
+ ut_assertok(ut_check_delta(start));
+
+ return 0;
+}
+LIB_TEST(lib_test_abuf_realloc_inc, 0);
+
/* Test handling of buffers that are too large */
static int lib_test_abuf_large(struct unit_test_state *uts)
{