]> sigrok.org Git - libsigrokdecode.git/commitdiff
tests: Rename DECODERS_DIR to DECODERS_TESTDIR
authorDaniel Elstner <redacted>
Sat, 3 Oct 2015 12:21:01 +0000 (14:21 +0200)
committerDaniel Elstner <redacted>
Sat, 3 Oct 2015 12:21:01 +0000 (14:21 +0200)
Avoid confusion resulting from using the same macro name for
different purposes.

Makefile.am
tests/decoder.c
tests/inst.c

index cd93059a68392f8bee8d99f5323c3aaa467e2398..a8df8f6e280a454d48cee9b23532eec39045fad9 100644 (file)
@@ -75,7 +75,7 @@ tests_main_SOURCES = \
        tests/inst.c \
        tests/session.c
 
-tests_main_CPPFLAGS = -DDECODERS_DIR='"$(abs_top_srcdir)/decoders"'
+tests_main_CPPFLAGS = -DDECODERS_TESTDIR='"$(abs_top_srcdir)/decoders"'
 tests_main_LDADD = libsigrokdecode.la $(SRD_EXTRA_LIBS) $(TESTS_LIBS)
 
 MAINTAINERCLEANFILES = ChangeLog
index 97d576788da45edea036c997a5adb72e3d5668e4..7763b0a1bc5272a91d05031dfeadca2f95f44b0b 100644 (file)
@@ -32,7 +32,7 @@ START_TEST(test_load_all)
 {
        int ret;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        ret = srd_decoder_load_all();
        fail_unless(ret == SRD_OK, "srd_decoder_load_all() failed: %d.", ret);
        srd_exit();
@@ -61,7 +61,7 @@ START_TEST(test_load)
 {
        int ret;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        ret = srd_decoder_load("uart");
        fail_unless(ret == SRD_OK, "srd_decoder_load(uart) failed: %d.", ret);
        ret = srd_decoder_load("spi");
@@ -78,7 +78,7 @@ END_TEST
  */
 START_TEST(test_load_bogus)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        /* http://sigrok.org/bugzilla/show_bug.cgi?id=176 */
        fail_unless(srd_decoder_load(NULL) != SRD_OK);
        fail_unless(srd_decoder_load("") != SRD_OK);
@@ -101,7 +101,7 @@ END_TEST
  */
 START_TEST(test_load_valid_and_bogus)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        fail_unless(srd_decoder_load("") != SRD_OK);
        fail_unless(srd_decoder_load("uart") == SRD_OK);
        fail_unless(srd_decoder_load("") != SRD_OK);
@@ -122,7 +122,7 @@ START_TEST(test_load_multiple)
 {
        int ret;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        ret = srd_decoder_load("uart");
        fail_unless(ret == SRD_OK, "Loading uart PD 1x failed: %d", ret);
        ret = srd_decoder_load("uart");
@@ -155,7 +155,7 @@ END_TEST
  */
 START_TEST(test_decoder_list)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load_all();
        fail_unless(srd_decoder_list() != NULL);
        srd_exit();
@@ -169,7 +169,7 @@ END_TEST
  */
 START_TEST(test_decoder_list_no_load)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        fail_unless(srd_decoder_list() == NULL);
        srd_exit();
 }
@@ -205,7 +205,7 @@ END_TEST
  */
 START_TEST(test_decoder_list_correct_numbers)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        fail_unless(g_slist_length((GSList *)srd_decoder_list()) == 0);
        srd_decoder_load("spi");
        fail_unless(g_slist_length((GSList *)srd_decoder_list()) == 1);
@@ -225,7 +225,7 @@ END_TEST
  */
 START_TEST(test_get_by_id)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load("uart");
        fail_unless(srd_decoder_get_by_id("uart") != NULL);
        fail_unless(srd_decoder_get_by_id("can") == NULL);
@@ -242,7 +242,7 @@ END_TEST
  */
 START_TEST(test_get_by_id_multiple)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load("uart");
        fail_unless(srd_decoder_get_by_id("uart") != NULL);
        fail_unless(srd_decoder_get_by_id("uart") != NULL);
@@ -258,7 +258,7 @@ END_TEST
  */
 START_TEST(test_get_by_id_bogus)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        fail_unless(srd_decoder_get_by_id(NULL) == NULL);
        fail_unless(srd_decoder_get_by_id("") == NULL);
        fail_unless(srd_decoder_get_by_id(" ") == NULL);
@@ -282,7 +282,7 @@ START_TEST(test_doc_get)
 {
        struct srd_decoder *dec;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load("uart");
        dec = srd_decoder_get_by_id("uart");
        fail_unless(srd_decoder_doc_get(dec) != NULL);
@@ -297,7 +297,7 @@ END_TEST
  */
 START_TEST(test_doc_get_null)
 {
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        fail_unless(srd_decoder_doc_get(NULL) == NULL);
        srd_exit();
 }
index 8d30b125b5d53a7b4579da1f50ccd8a5b4098667..d227a51aa472cdd91c2338337747688db9f09190 100644 (file)
@@ -33,7 +33,7 @@ START_TEST(test_inst_new)
        struct srd_session *sess;
        struct srd_decoder_inst *inst;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load("uart");
        srd_session_new(&sess);
        inst = srd_inst_new(sess, "uart", NULL);
@@ -53,7 +53,7 @@ START_TEST(test_inst_new_multiple)
 
        inst1 = inst2 = inst3 = NULL;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load_all();
        srd_session_new(&sess);
 
@@ -90,7 +90,7 @@ START_TEST(test_inst_option_set_empty)
        struct srd_decoder_inst *inst;
        GHashTable *options;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load_all();
        srd_session_new(&sess);
        inst = srd_inst_new(sess, "uart", NULL);
@@ -114,7 +114,7 @@ START_TEST(test_inst_option_set_bogus)
        struct srd_decoder_inst *inst;
        GHashTable *options;
 
-       srd_init(DECODERS_DIR);
+       srd_init(DECODERS_TESTDIR);
        srd_decoder_load_all();
        srd_session_new(&sess);
        inst = srd_inst_new(sess, "uart", NULL);