diff options
Diffstat (limited to 'libctf/testsuite/libctf-lookup')
-rw-r--r-- | libctf/testsuite/libctf-lookup/add-to-opened.c | 15 | ||||
-rw-r--r-- | libctf/testsuite/libctf-lookup/lookup.exp | 5 |
2 files changed, 19 insertions, 1 deletions
diff --git a/libctf/testsuite/libctf-lookup/add-to-opened.c b/libctf/testsuite/libctf-lookup/add-to-opened.c index 96629af..700257e 100644 --- a/libctf/testsuite/libctf-lookup/add-to-opened.c +++ b/libctf/testsuite/libctf-lookup/add-to-opened.c @@ -15,7 +15,7 @@ main (int argc, char *argv[]) ctf_encoding_t en = { CTF_INT_SIGNED, 0, sizeof (int) }; unsigned char *ctf_written; size_t size; - int err; + int err = 666; if (argc != 2) { @@ -25,9 +25,18 @@ main (int argc, char *argv[]) if ((ctf = ctf_open (argv[1], NULL, &err)) == NULL) goto open_err; + + /* The error int should be reset on success as well as on error. */ + if (err != 0) + goto err_err; + + err = 666; if ((fp = ctf_dict_open (ctf, NULL, &err)) == NULL) goto open_err; + if (err != 0) + goto err_err; + /* Check that various modifications to already-written types are prohibited. */ @@ -145,4 +154,8 @@ main (int argc, char *argv[]) open_err: fprintf (stderr, "%s: cannot open: %s\n", argv[0], ctf_errmsg (err)); return 1; + + err_err: + fprintf (stderr, "%s: open error not set to success on success\n", argv[0]); + return 1; } diff --git a/libctf/testsuite/libctf-lookup/lookup.exp b/libctf/testsuite/libctf-lookup/lookup.exp index a8b09c2..d15c315 100644 --- a/libctf/testsuite/libctf-lookup/lookup.exp +++ b/libctf/testsuite/libctf-lookup/lookup.exp @@ -28,6 +28,11 @@ if {![check_ctf_available]} { return 0 } +if {![check_ctf_linker_dedup]} { + unsupported "no CTF deduplication support in the linker" + return 0 +} + if {[info exists env(LC_ALL)]} { set old_lc_all $env(LC_ALL) } |