This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=87c060b24b724f30e79406bc66b5342581ee29f1

commit 87c060b24b724f30e79406bc66b5342581ee29f1
Author: Guillem Jover <[email protected]>
AuthorDate: Tue Jun 5 05:32:02 2018 +0200

    libdpkg: Improve unit test to use assigned variable
    
    Add a couple of checks to make the test more robust, and to use an
    assigned variable.
    
    Warned-by: cppcheck
---
 lib/dpkg/t/t-string.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/dpkg/t/t-string.c b/lib/dpkg/t/t-string.c
index 1f5ee4cbe..fc2819b55 100644
--- a/lib/dpkg/t/t-string.c
+++ b/lib/dpkg/t/t-string.c
@@ -150,6 +150,8 @@ test_str_escape_fmt(void)
        memset(buf, 'a', sizeof(buf));
        q = str_escape_fmt(buf, NULL, 0);
        test_mem(buf, ==, "aaaa", 4);
+       test_pass(buf == q);
+       test_pass(strnlen(buf, sizeof(buf)) == sizeof(buf));
 
        memset(buf, 'a', sizeof(buf));
        q = str_escape_fmt(buf, "b", 1);
@@ -228,7 +230,7 @@ test_str_strip_quotes(void)
 
 TEST_ENTRY(test)
 {
-       test_plan(60);
+       test_plan(62);
 
        test_str_is_set();
        test_str_match_end();

-- 
Dpkg.Org's dpkg

Reply via email to