diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-08-12 18:23:25 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-08-12 18:25:18 +0100 |
commit | 55daa953fb82412e2e4dced4a39c6f7a3ff39b46 (patch) | |
tree | 0ecd41cdad183030d25a047224b51a399adb0b7a /src/tests | |
parent | d105627928b90c2031894e1771098848cc74a7c0 (diff) | |
download | ipxe-55daa953fb82412e2e4dced4a39c6f7a3ff39b46.zip ipxe-55daa953fb82412e2e4dced4a39c6f7a3ff39b46.tar.gz ipxe-55daa953fb82412e2e4dced4a39c6f7a3ff39b46.tar.bz2 |
[settings] Allow numeric_setting_value() to handle long setting values
Allow numeric_setting_value() to handle e.g. the byte sequence
00:00:00:00:12:34:56:78
by returning -ERANGE only if the value actually overflows the return
type.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/settings_test.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tests/settings_test.c b/src/tests/settings_test.c index 670d549..d1d923a 100644 --- a/src/tests/settings_test.c +++ b/src/tests/settings_test.c @@ -342,6 +342,12 @@ static void settings_test_exec ( void ) { RAW ( 0x98, 0xab, 0x41, 0x81 ), 0x98ab4181 ); fetchn_ok ( &test_settings, &test_uint32_setting, RAW ( 0xff, 0xff, 0xfe ), 0x00fffffe ); + fetchn_ok ( &test_settings, &test_uint32_setting, + RAW ( 0, 0, 0, 0x12, 0x34, 0x56, 0x78 ), 0x12345678 ); + fetchn_ok ( &test_settings, &test_int32_setting, + RAW ( 0, 0, 0, 0x12, 0x34, 0x56, 0x78 ), 0x12345678 ); + fetchn_ok ( &test_settings, &test_int32_setting, + RAW ( 0xff, 0xff, 0x87, 0x65, 0x43, 0x21 ), -0x789abcdf ); /* "hex" setting type */ storef_ok ( &test_settings, &test_hex_setting, |