From 5ed21edab66dbfb50366d32a50f384ecf66918ad Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 29 May 2019 21:18:00 -0400
Subject: [PATCH 2/2] Fix broken tests using incorrect types.
These tests were using the wrong type for the given options.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
subprojects/libinsane/tests/tests_workaround_cache.c | 4 ++--
.../libinsane/tests/tests_workaround_check_capabilities.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/subprojects/libinsane/tests/tests_workaround_cache.c b/subprojects/libinsane/tests/tests_workaround_cache.c
index 78def74..7650243 100644
--- a/subprojects/libinsane/tests/tests_workaround_cache.c
+++ b/subprojects/libinsane/tests/tests_workaround_cache.c
@@ -279,7 +279,7 @@ static void test_cache_set_value_2(void)
LIS_ASSERT_EQUAL(lis_dumb_get_nb_get(g_dumb), 1);
LIS_ASSERT_EQUAL(lis_dumb_get_nb_set(g_dumb), 0);
- value.string = OPT_VALUE_SOURCE_ADF;
+ value.integer = 240;
err = opts[1]->fn.set_value(opts[1], value, &set_flags);
LIS_ASSERT_TRUE(LIS_IS_OK(err));
LIS_ASSERT_EQUAL(
@@ -293,7 +293,7 @@ static void test_cache_set_value_2(void)
// since we got flag 'reload_options', this get_value() will go through
err = opts[1]->fn.get_value(opts[1], &value);
LIS_ASSERT_TRUE(LIS_IS_OK(err));
- LIS_ASSERT_EQUAL(strcmp(value.string, OPT_VALUE_SOURCE_ADF), 0);
+ LIS_ASSERT_EQUAL(value.integer, 240);
LIS_ASSERT_EQUAL(lis_dumb_get_nb_get(g_dumb), 3);
LIS_ASSERT_EQUAL(lis_dumb_get_nb_set(g_dumb), 1);
diff --git a/subprojects/libinsane/tests/tests_workaround_check_capabilities.c b/subprojects/libinsane/tests/tests_workaround_check_capabilities.c
index d055e94..2abdb25 100644
--- a/subprojects/libinsane/tests/tests_workaround_check_capabilities.c
+++ b/subprojects/libinsane/tests/tests_workaround_check_capabilities.c
@@ -73,8 +73,8 @@ static int tests_init(void)
.desc = "source desc",
.capabilities = LIS_CAP_SW_SELECT,
.value = {
- .type = LIS_TYPE_INTEGER,
- .unit = LIS_UNIT_DPI,
+ .type = LIS_TYPE_STRING,
+ .unit = LIS_UNIT_NONE,
},
.constraint = {
.type = LIS_CONSTRAINT_LIST,
--
2.21.0