summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Brown2013-07-12 14:58:19 +0200
committerMichael Brown2013-07-12 15:14:36 +0200
commit9f3bbaca0737dfa90bd9a8074d08e85caed69b6c (patch)
tree53fa63ed06a63ec1571caa7dedde4011c2c0aa9b /src/tests
parent[settings] Use hex_decode() to parse hex settings (diff)
downloadipxe-9f3bbaca0737dfa90bd9a8074d08e85caed69b6c.tar.gz
ipxe-9f3bbaca0737dfa90bd9a8074d08e85caed69b6c.tar.xz
ipxe-9f3bbaca0737dfa90bd9a8074d08e85caed69b6c.zip
[settings] Add "hexraw" setting type
Originally-implemented-by: Jeppe Toustrup <ipxe@tenzer.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/settings_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/settings_test.c b/src/tests/settings_test.c
index 3156f8d2..d6d12574 100644
--- a/src/tests/settings_test.c
+++ b/src/tests/settings_test.c
@@ -170,6 +170,12 @@ static struct setting test_hexhyp_setting = {
.type = &setting_type_hexhyp,
};
+/** Test raw hex string setting type */
+static struct setting test_hexraw_setting = {
+ .name = "test_hexraw",
+ .type = &setting_type_hexraw,
+};
+
/** Test UUID setting type */
static struct setting test_uuid_setting = {
.name = "test_uuid",
@@ -262,6 +268,14 @@ static void settings_test_exec ( void ) {
0x09, 0x6c, 0x66, 0x13, 0xc1, 0xa8, 0xec, 0x27 ),
"9f-e5-6d-fb-24-3a-4c-bb-a9-09-6c-66-13-c1-a8-ec-27" );
+ /* "hexraw" setting type */
+ storef_ok ( &test_settings, &test_hexraw_setting,
+ "012345abcdef", RAW ( 0x01, 0x23, 0x45, 0xab, 0xcd, 0xef ));
+ fetchf_ok ( &test_settings, &test_hexraw_setting,
+ RAW ( 0x9e, 0x4b, 0x6e, 0xef, 0x36, 0xb6, 0x46, 0xfe, 0x8f,
+ 0x17, 0x06, 0x39, 0x6b, 0xf4, 0x48, 0x4e ),
+ "9e4b6eef36b646fe8f1706396bf4484e" );
+
/* "uuid" setting type (no store capability) */
fetchf_ok ( &test_settings, &test_uuid_setting,
RAW ( 0x1a, 0x6a, 0x74, 0x9d, 0x0e, 0xda, 0x46, 0x1a,0xa8,