The following commit has been merged in the master branch:
commit 07a8f6d882c019ed039442237c53d8333dc9c4a5
Author: Guillem Jover <[email protected]>
Date: Fri Sep 16 17:23:53 2011 +0200
libdpkg: Add more test cases for version parsing failures
diff --git a/lib/dpkg/test/t-version.c b/lib/dpkg/test/t-version.c
index 9975084..090ae23 100644
--- a/lib/dpkg/test/t-version.c
+++ b/lib/dpkg/test/t-version.c
@@ -137,6 +137,15 @@ test_version_parse(void)
test_pass(parseversion(&a, "0:0-azAZ09.+~") == NULL);
test_pass(versioncompare(&a, &b) == 0);
+ /* Test empty version. */
+ test_fail(parseversion(&a, "") == NULL);
+
+ /* Test empty upstream version after epoch. */
+ test_fail(parseversion(&a, "0:") == NULL);
+
+ /* Test version with embedded spaces. */
+ test_fail(parseversion(&a, "0:0 0-1") == NULL);
+
/* Test invalid characters in epoch. */
test_fail(parseversion(&a, "a:0-0") == NULL);
test_fail(parseversion(&a, "A:0-0") == NULL);
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]