treewide: tests: uncomment previously failing test assertions
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 29 Aug 2019 07:41:37 +0000 (09:41 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Thu, 29 Aug 2019 07:41:37 +0000 (09:41 +0200)
Mainline commit 2c60e6b5c924 ("gpiolib: never report open-drain/source
lines as 'input' to user-space") in the linux kernel has now been
backported to v5.2 stable branch and released in linux v5.2.11. We can
now enable back the assertions that were previously failed in test
suites (core, C++ and python). The required kernel versions must be
updated as well.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
bindings/cxx/tests/gpiod-cxx-test.cpp
bindings/cxx/tests/tests-line.cpp
bindings/python/tests/gpiod_py_test.py
tests/gpiod-test.c
tests/tests-line.c

index e110a3ced8a1464658b9b4df17bc38d63e839a54..11c895ed2bbdb7211e593836e65211c785a26979 100644 (file)
@@ -54,6 +54,6 @@ public:
        kernel_checker& operator=(kernel_checker&& other) = delete;
 };
 
-kernel_checker require_kernel(5, 2, 7);
+kernel_checker require_kernel(5, 2, 11);
 
 } /* namespace */
index 9e7e1b0b107e42d4f72f2f9637933e4f5795761d..b008c30fa940b65adf28cdddb5ebf05bbb6e7278 100644 (file)
@@ -82,8 +82,7 @@ TEST_CASE("Line information can be correctly retrieved", "[line]")
 
                REQUIRE(line.offset() == 4);
                REQUIRE(line.name() == "gpio-mockup-A-4");
-               /* FIXME Uncomment the line below once this issue is fixed in the kernel. */
-               //REQUIRE(line.direction() == ::gpiod::line::DIRECTION_OUTPUT);
+               REQUIRE(line.direction() == ::gpiod::line::DIRECTION_OUTPUT);
                REQUIRE(line.active_state() == ::gpiod::line::ACTIVE_LOW);
                REQUIRE(line.is_requested());
                REQUIRE(line.is_used());
index a66a22739113e4029c6daafbc2843a4a9d42c841..9cc15af508b233b6d312164e0efd74244c126b56 100755 (executable)
@@ -299,8 +299,7 @@ class LineInfo(MockupTestCase):
                          flags=flags)
             self.assertEqual(line.offset(), 4)
             self.assertEqual(line.name(), 'gpio-mockup-A-4')
-            # FIXME Uncomment the line below once this issue is fixed in the kernel.
-            #self.assertEqual(line.direction(), gpiod.Line.DIRECTION_OUTPUT)
+            self.assertEqual(line.direction(), gpiod.Line.DIRECTION_OUTPUT)
             self.assertEqual(line.active_state(), gpiod.Line.ACTIVE_LOW)
             self.assertEqual(line.consumer(), default_consumer)
             self.assertTrue(line.is_used())
@@ -655,6 +654,6 @@ class EventFileDescriptor(MockupTestCase):
 #
 
 if __name__ == '__main__':
-    check_kernel(5, 2, 7)
+    check_kernel(5, 2, 11)
     mockup = gpiomockup.Mockup()
     unittest.main()
index 1d962aad07ac6defbfc79a7144219b78c31ec309..c970cfd3b8016cd01413b22973b17f1697230715 100644 (file)
@@ -17,7 +17,7 @@
 
 #define MIN_KERNEL_MAJOR       5
 #define MIN_KERNEL_MINOR       2
-#define MIN_KERNEL_RELEASE     7
+#define MIN_KERNEL_RELEASE     11
 #define MIN_KERNEL_VERSION     KERNEL_VERSION(MIN_KERNEL_MAJOR, \
                                               MIN_KERNEL_MINOR, \
                                               MIN_KERNEL_RELEASE)
index 7458992781194594810f7bf137ca39d67730ee1e..47922111bf18a260a8749f973a87028e1172ce9e 100644 (file)
@@ -475,14 +475,8 @@ GPIOD_TEST_CASE(misc_flags, 0, { 8 })
        g_assert_true(gpiod_line_is_used(line));
        g_assert_false(gpiod_line_is_open_drain(line));
        g_assert_true(gpiod_line_is_open_source(line));
-       /*
-        * FIXME Enable the line below once the open-source/drain issue is
-        * fixed in the kernel.
-        */
-/*
        g_assert_cmpint(gpiod_line_direction(line), ==,
                        GPIOD_LINE_DIRECTION_OUTPUT);
-*/
 }
 
 GPIOD_TEST_CASE(misc_flags_work_together, 0, { 8 })
@@ -518,14 +512,8 @@ GPIOD_TEST_CASE(misc_flags_work_together, 0, { 8 })
        g_assert_false(gpiod_line_is_open_source(line));
        g_assert_cmpint(gpiod_line_active_state(line), ==,
                        GPIOD_LINE_ACTIVE_STATE_LOW);
-       /*
-        * FIXME Enable the line below once the open-source/drain issue is
-        * fixed in the kernel.
-        */
-/*
        g_assert_cmpint(gpiod_line_direction(line), ==,
                        GPIOD_LINE_DIRECTION_OUTPUT);
-*/
 
        gpiod_line_release(line);