Displaying 7 results from an estimated 7 matches for "0garbage".
Did you mean:
garbage
2018 Feb 07
0
[nbdkit PATCH v2 2/2] utils: Revamp nbdkit_parse_size
...43 deletions(-)
diff --git a/src/test-utils.c b/src/test-utils.c
index e26a6f3..80bef2e 100644
--- a/src/test-utils.c
+++ b/src/test-utils.c
@@ -61,19 +61,19 @@ test_nbdkit_parse_size (void)
{ "", -1 },
{ "0x0", -1 },
{ "garbage", -1 },
- /* { "0garbage", -1 }, */
- /* { "-1", -1 }, */
- /* { "-2", -1 }, */
- /* { "9223372036854775808", -1 }, */
- /* { "-9223372036854775808", -1 }, */
- /* { "8E", -1 }, */
- /* { "8192P", -1 }, */
- /* { "9999999999999999999...
2018 Feb 07
3
[nbdkit PATCH v2 0/2] Improve nbdkit_parse_size
Take two, this time split into two patches. I liked Rich's
suggestion of unit-testing src/ files directly in src/, and
automake is a lot happier with this than with my v1 attempt
that tried to compile .c files across directories.
It's still enough of a change that I'm not pushing it right
away.
Eric Blake (2):
build: Add unit-testing of internal files
utils: Revamp
2019 Feb 08
2
[PATCH nbdkit v2] server: utils: Make nbdkit_parse_size to reject negative values
..., 38 insertions(+), 9 deletions(-)
diff --git a/server/test-utils.c b/server/test-utils.c
index f51f63a..3965fd3 100644
--- a/server/test-utils.c
+++ b/server/test-utils.c
@@ -62,14 +62,26 @@ test_nbdkit_parse_size (void)
{ "0x0", -1 },
{ "garbage", -1 },
{ "0garbage", -1 },
- { "-1", -1 },
- { "-2", -1 },
- { "9223372036854775808", -1 },
- { "-9223372036854775808", -1 },
{ "8E", -1 },
{ "8192P", -1 },
+
+ /* Strings leading to overflow */
+ { "9223372036854775808&...
2019 Feb 07
1
[PATCH nbdkit] server: utils: Fix nbdkit_parse_size to correctly handle negative values
..., 38 insertions(+), 9 deletions(-)
diff --git a/server/test-utils.c b/server/test-utils.c
index f51f63a..3965fd3 100644
--- a/server/test-utils.c
+++ b/server/test-utils.c
@@ -62,14 +62,26 @@ test_nbdkit_parse_size (void)
{ "0x0", -1 },
{ "garbage", -1 },
{ "0garbage", -1 },
- { "-1", -1 },
- { "-2", -1 },
- { "9223372036854775808", -1 },
- { "-9223372036854775808", -1 },
{ "8E", -1 },
{ "8192P", -1 },
+
+ /* Strings leading to overflow */
+ { "9223372036854775808&...
2018 Feb 02
0
[RFC nbdkit PATCH] utils: Revamp nbdkit_parse_size
...error_flagged = true;
+}
+
+static bool
+test_nbdkit_parse_size (void)
+{
+ bool pass = true;
+ struct pair {
+ const char *str;
+ int64_t res;
+ } pairs[] = {
+ /* Bogus strings */
+ { "", -1 },
+ { "0x0", -1 },
+ { "garbage", -1 },
+ { "0garbage", -1 },
+ { "M", -1 },
+ { "-1", -1 },
+ { "-2", -1 },
+ { "9223372036854775808", -1 },
+ { "-9223372036854775808", -1 },
+ { "8E", -1 },
+ { "8192P", -1 },
+
+ /* Valid strings */
+ { "0"...
2023 Sep 03
1
[PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
This is the first part of a pair of patch series which aim to let us
use nbdkit_parse_size (or rather, an equivalent common function) in
nbdcopy, so we can write:
nbdcopy --request-size=32M ...
We can't do that now which was annoying me earlier in the week.
This commit creates a new function called human_size_parse which is
basically nbdkit_parse_size, and turns nbdkit_parse_size into a
2023 Sep 03
5
[PATCH libnbd 0/5] copy: Allow human sizes for --queue-size, etc
See companion patch:
Subject: [PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
This is the second part of the patch. It adds the new
human_size_parse function to libnbd and then uses it for parsing
--queue-size, --request-size and --sparse.
The main complication here is that there was already a
common/utils/human-size.h header which ends up (eventually)