]> sigrok.org Git - libsigrokdecode.git/blobdiff - tests/decoder.c
avr_isp: Add more parts
[libsigrokdecode.git] / tests / decoder.c
index 36784102bff934be9415bf657893e6b450757ac3..3acabaeca30e2c7c30c910eec8ff0c61323596e1 100644 (file)
@@ -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