summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorMichael Brown2015-04-24 14:54:40 +0200
committerMichael Brown2015-04-24 16:36:41 +0200
commitdc15a5a77942abf2c39f2de4ee5a2b7150ea89e1 (patch)
treef7802ca1decc81b35d0ba99ff6d5980f8d7f61bf /src/tests
parent[base64] Add buffer size parameter to base64_encode() and base64_decode() (diff)
downloadipxe-dc15a5a77942abf2c39f2de4ee5a2b7150ea89e1.tar.gz
ipxe-dc15a5a77942abf2c39f2de4ee5a2b7150ea89e1.tar.xz
ipxe-dc15a5a77942abf2c39f2de4ee5a2b7150ea89e1.zip
[settings] Add "base64" setting type
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/settings_test.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tests/settings_test.c b/src/tests/settings_test.c
index d80a6ea8..f7fb35d0 100644
--- a/src/tests/settings_test.c
+++ b/src/tests/settings_test.c
@@ -232,6 +232,12 @@ static struct setting test_hexraw_setting = {
.type = &setting_type_hexraw,
};
+/** Test Base64 setting type */
+static struct setting test_base64_setting = {
+ .name = "test_base64",
+ .type = &setting_type_base64,
+};
+
/** Test UUID setting type */
static struct setting test_uuid_setting = {
.name = "test_uuid",
@@ -383,6 +389,15 @@ static void settings_test_exec ( void ) {
0x17, 0x06, 0x39, 0x6b, 0xf4, 0x48, 0x4e ),
"9e4b6eef36b646fe8f1706396bf4484e" );
+ /* "base64" setting type */
+ storef_ok ( &test_settings, &test_base64_setting,
+ "cGFzc6\nNwaHJhc2U= ",
+ RAW ( 0x70, 0x61, 0x73, 0x73, 0xa3, 0x70, 0x68, 0x72, 0x61,
+ 0x73, 0x65 ) );
+ fetchf_ok ( &test_settings, &test_base64_setting,
+ RAW ( 0x80, 0x81, 0x82, 0x83, 0x84, 0x00, 0xff ),
+ "gIGCg4QA/w==" );
+
/* "uuid" setting type (no store capability) */
fetchf_ok ( &test_settings, &test_uuid_setting,
RAW ( 0x1a, 0x6a, 0x74, 0x9d, 0x0e, 0xda, 0x46, 0x1a,0xa8,