diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2019-11-12 22:47:41 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2019-12-09 15:42:34 +0100 |
commit | f8c24e2e58ee76e6bdc50b87060e2efb7e8838ba (patch) | |
tree | 396623c2d38f02f721cab1b31e344b8adf8b7bb0 /tests/decoder.c | |
parent | 5d6d8896ded87ce72b42e68c77120008b2d1b779 (diff) | |
download | libsigrokdecode-f8c24e2e58ee76e6bdc50b87060e2efb7e8838ba.tar.gz libsigrokdecode-f8c24e2e58ee76e6bdc50b87060e2efb7e8838ba.zip |
srd_decoder_doc_get(): Add an additional sanity check.
Diffstat (limited to 'tests/decoder.c')
-rw-r--r-- | tests/decoder.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/decoder.c b/tests/decoder.c index 3678410..3acabae 100644 --- a/tests/decoder.c +++ b/tests/decoder.c @@ -404,11 +404,19 @@ END_TEST * Check whether srd_decoder_doc_get() fails with NULL as argument. * If it returns a value != NULL (or segfaults) this test will fail. * See also: http://sigrok.org/bugzilla/show_bug.cgi?id=179 + * Check whether srd_decoder_doc_get() fails with dec->py_mod == NULL. + * If it returns a value != NULL (or segfaults) this test will fail. + * See also: http://sigrok.org/bugzilla/show_bug.cgi?id=180 */ START_TEST(test_doc_get_null) { + struct srd_decoder dec; + + dec.py_mod = NULL; + srd_init(DECODERS_TESTDIR); fail_unless(srd_decoder_doc_get(NULL) == NULL); + fail_unless(srd_decoder_doc_get(&dec) == NULL); srd_exit(); } END_TEST |