diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-11-26 14:00:30 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-11-26 14:00:30 +0300 |
commit | 414ea1706306e061fc44a8b5ce3042d4f0728489 (patch) | |
tree | ef0b2c4eac79e479ed686a5d88d7b3b954717824 /lib/dpkg/t/t-error.c | |
parent | ed2b463626bd721942143baa6207f2ccac67a616 (diff) | |
parent | 89afa9af7cd589eb8384ed96b6d86dd59d56bdf5 (diff) | |
download | dpkg-414ea1706306e061fc44a8b5ce3042d4f0728489.tar.gz |
Merge https://salsa.debian.org/dpkg-team/dpkg
Diffstat (limited to 'lib/dpkg/t/t-error.c')
-rw-r--r-- | lib/dpkg/t/t-error.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/dpkg/t/t-error.c b/lib/dpkg/t/t-error.c index 5e2f55fcd..e93459e7e 100644 --- a/lib/dpkg/t/t-error.c +++ b/lib/dpkg/t/t-error.c @@ -42,10 +42,12 @@ test_dpkg_error_put(void) test_pass(dpkg_put_errno(NULL, "void error") < 0); test_pass(dpkg_put_warn(&err, "test warning %d", 10) < 0); + test_pass(err.syserrno == 0); test_str(err.str, ==, "test warning 10"); test_warn(err); test_pass(dpkg_put_error(&err, "test error %d", 20) < 0); + test_pass(err.syserrno == 0); test_str(err.str, ==, "test error 20"); test_error(err); @@ -54,6 +56,7 @@ test_dpkg_error_put(void) test_bail("cannot allocate string"); test_pass(dpkg_put_errno(&err, "test errno %d", 30) < 0); test_str(err.str, ==, errstr_ref); + test_pass(err.syserrno == ENOENT); test_error(err); free(errstr_ref); errno = 0; @@ -64,17 +67,20 @@ test_dpkg_error_destroy(void) { struct dpkg_error err = DPKG_ERROR_INIT; - test_pass(dpkg_put_error(&err, "test destroy") < 0); + errno = ENOENT; + test_pass(dpkg_put_errno(&err, "test destroy") < 0); + test_pass(err.syserrno == ENOENT); test_pass(err.type == DPKG_MSG_ERROR); test_pass(err.str != NULL); dpkg_error_destroy(&err); test_pass(err.type == DPKG_MSG_NONE); + test_pass(err.syserrno == 0); test_pass(err.str == NULL); } TEST_ENTRY(test) { - test_plan(19); + test_plan(24); test_dpkg_error_put(); test_dpkg_error_destroy(); |