bindings: cxx: Migrate C++ tests to use Catch2 v3
authorKhem Raj <raj.khem@gmail.com>
Fri, 31 May 2024 18:42:23 +0000 (11:42 -0700)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 3 Jun 2024 09:36:22 +0000 (11:36 +0200)
Catch2 v3.x has API changes which needs to be addressed
in the tests themselves, hence this changeset is to fix
those.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Link: https://lore.kernel.org/r/20240531184223.3949069-1-raj.khem@gmail.com
[Bartosz: added a version requirement (>= 3.0) for catch2 to configure.ac]
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
16 files changed:
TODO
bindings/cxx/tests/Makefile.am
bindings/cxx/tests/gpiod-cxx-test-main.cpp
bindings/cxx/tests/helpers.hpp
bindings/cxx/tests/tests-chip-info.cpp
bindings/cxx/tests/tests-chip.cpp
bindings/cxx/tests/tests-edge-event.cpp
bindings/cxx/tests/tests-info-event.cpp
bindings/cxx/tests/tests-line-config.cpp
bindings/cxx/tests/tests-line-info.cpp
bindings/cxx/tests/tests-line-request.cpp
bindings/cxx/tests/tests-line-settings.cpp
bindings/cxx/tests/tests-line.cpp
bindings/cxx/tests/tests-misc.cpp
bindings/cxx/tests/tests-request-config.cpp
configure.ac

diff --git a/TODO b/TODO
index 10e5af9e9813d109fff8bc35b2152550b7926fdb..79a6246121ffc19d9683ba7e2dd048300117adf5 100644 (file)
--- a/TODO
+++ b/TODO
@@ -51,10 +51,3 @@ testing with gpio-tools-test.bash using coproc problematic).
 
 One approach that could address both these problems is to bypass the readline
 emulation and use the libedit API (histedit.h) directly.
-
-----------
-
-* migrate C++ tests to Catch2 v3
-
-It's been almost two years since Catch2 v3.0 was released. It's not backward
-compatible and requires some rework of the C++ test-suite.
index fbf80a105587ec53659c5e0bbae52da94f7454eb..d9284da1b915e84ce7b8512ffa1da453192094bf 100644 (file)
@@ -4,7 +4,7 @@
 AM_CXXFLAGS = -I$(top_srcdir)/bindings/cxx/ -I$(top_srcdir)/include
 AM_CXXFLAGS += -I$(top_srcdir)/tests/gpiosim/
 AM_CXXFLAGS += -Wall -Wextra -g -std=gnu++17 $(CATCH2_CFLAGS)
-AM_LDFLAGS = -pthread
+AM_LDFLAGS = -pthread $(CATCH2_LIBS)
 LDADD = $(top_builddir)/bindings/cxx/libgpiodcxx.la
 LDADD += $(top_builddir)/tests/gpiosim/libgpiosim.la
 
index 11bf8e5029fadd785224b8830242f68b099c9501..ec482862e784ecbfdfc41fc6fdd4308688c02322 100644 (file)
@@ -1,5 +1,4 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2017-2021 Bartosz Golaszewski <bartekgola@gmail.com>
 
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
index 62d98270d84778309dab1c4b2c231cbf177bee3e..62bbdf512617d43a0b21bafa57217673a5681cb7 100644 (file)
@@ -4,13 +4,13 @@
 #ifndef __GPIOD_CXX_TEST_HELPERS_HPP__
 #define __GPIOD_CXX_TEST_HELPERS_HPP__
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <regex>
 #include <string>
 #include <sstream>
 #include <system_error>
 
-class system_error_matcher : public Catch::MatcherBase<::std::system_error>
+class system_error_matcher : public Catch::Matchers::MatcherBase<::std::system_error>
 {
 public:
        explicit system_error_matcher(int expected_errno);
@@ -21,7 +21,7 @@ private:
        ::std::error_condition _m_cond;
 };
 
-class regex_matcher : public Catch::MatcherBase<::std::string>
+class regex_matcher : public Catch::Matchers::MatcherBase<::std::string>
 {
 public:
        explicit regex_matcher(const ::std::string& pattern);
@@ -33,7 +33,7 @@ private:
        ::std::string _m_repr;
 };
 
-template<class T> class stringify_matcher : public Catch::MatcherBase<T>
+template<class T> class stringify_matcher : public Catch::Matchers::MatcherBase<T>
 {
 public:
        explicit stringify_matcher(const ::std::string& expected) : _m_expected(expected)
index 717c387fe4d5fa61ce74b07d65c36e1222dc9146..2c54f53c19f27d4e0a2a392d59f00fc1b0a259e6 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <gpiod.hpp>
 #include <sstream>
 
@@ -24,12 +24,12 @@ TEST_CASE("chip_info properties can be read", "[chip-info][chip]")
 
        SECTION("get chip name")
        {
-               REQUIRE_THAT(info.name(), Catch::Equals(sim.name()));
+               REQUIRE_THAT(info.name(), Catch::Matchers::Equals(sim.name()));
        }
 
        SECTION("get chip label")
        {
-               REQUIRE_THAT(info.label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(info.label(), Catch::Matchers::Equals("foobar"));
        }
 
        SECTION("get num_lines")
@@ -52,12 +52,12 @@ TEST_CASE("chip_info can be copied and moved", "[chip-info]")
        {
                auto copy(info);
 
-               REQUIRE_THAT(copy.name(), Catch::Equals(sim.name()));
-               REQUIRE_THAT(copy.label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(copy.name(), Catch::Matchers::Equals(sim.name()));
+               REQUIRE_THAT(copy.label(), Catch::Matchers::Equals("foobar"));
                REQUIRE(copy.num_lines() == 4);
 
-               REQUIRE_THAT(info.name(), Catch::Equals(sim.name()));
-               REQUIRE_THAT(info.label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(info.name(), Catch::Matchers::Equals(sim.name()));
+               REQUIRE_THAT(info.label(), Catch::Matchers::Equals("foobar"));
                REQUIRE(info.num_lines() == 4);
        }
 
@@ -67,12 +67,12 @@ TEST_CASE("chip_info can be copied and moved", "[chip-info]")
 
                copy = info;
 
-               REQUIRE_THAT(copy.name(), Catch::Equals(sim.name()));
-               REQUIRE_THAT(copy.label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(copy.name(), Catch::Matchers::Equals(sim.name()));
+               REQUIRE_THAT(copy.label(), Catch::Matchers::Equals("foobar"));
                REQUIRE(copy.num_lines() == 4);
 
-               REQUIRE_THAT(info.name(), Catch::Equals(sim.name()));
-               REQUIRE_THAT(info.label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(info.name(), Catch::Matchers::Equals(sim.name()));
+               REQUIRE_THAT(info.label(), Catch::Matchers::Equals("foobar"));
                REQUIRE(info.num_lines() == 4);
        }
 
@@ -80,8 +80,8 @@ TEST_CASE("chip_info can be copied and moved", "[chip-info]")
        {
                auto moved(std::move(info));
 
-               REQUIRE_THAT(moved.name(), Catch::Equals(sim.name()));
-               REQUIRE_THAT(moved.label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(moved.name(), Catch::Matchers::Equals(sim.name()));
+               REQUIRE_THAT(moved.label(), Catch::Matchers::Equals("foobar"));
                REQUIRE(moved.num_lines() == 4);
        }
 
@@ -91,8 +91,8 @@ TEST_CASE("chip_info can be copied and moved", "[chip-info]")
 
                moved = ::std::move(info);
 
-               REQUIRE_THAT(moved.name(), Catch::Equals(sim.name()));
-               REQUIRE_THAT(moved.label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(moved.name(), Catch::Matchers::Equals(sim.name()));
+               REQUIRE_THAT(moved.label(), Catch::Matchers::Equals("foobar"));
                REQUIRE(moved.num_lines() == 4);
        }
 }
index c5ec19bbb43c94962b39bd3fc1d29d60249325b1..1ab7addc01c90503d7f114cf4de6d8207d95d9ad 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <gpiod.hpp>
 #include <sstream>
 #include <system_error>
@@ -48,9 +48,9 @@ TEST_CASE("chip constructor works", "[chip]")
                        .build();
 
                ::gpiod::chip first(sim.dev_path());
-               REQUIRE_THAT(first.get_info().label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(first.get_info().label(), Catch::Matchers::Equals("foobar"));
                ::gpiod::chip second(::std::move(first));
-               REQUIRE_THAT(second.get_info().label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(second.get_info().label(), Catch::Matchers::Equals("foobar"));
        }
 }
 
@@ -70,9 +70,9 @@ TEST_CASE("chip operators work", "[chip]")
 
                ::gpiod::chip moved_chip(moved_sim.dev_path());
 
-               REQUIRE_THAT(chip.get_info().label(), Catch::Equals("foobar"));
+               REQUIRE_THAT(chip.get_info().label(), Catch::Matchers::Equals("foobar"));
                chip = ::std::move(moved_chip);
-               REQUIRE_THAT(chip.get_info().label(), Catch::Equals("moved"));
+               REQUIRE_THAT(chip.get_info().label(), Catch::Matchers::Equals("moved"));
        }
 
        SECTION("boolean operator")
@@ -94,7 +94,7 @@ TEST_CASE("chip properties can be read", "[chip]")
 
        SECTION("get device path")
        {
-               REQUIRE_THAT(chip.path(), Catch::Equals(sim.dev_path()));
+               REQUIRE_THAT(chip.path(), Catch::Matchers::Equals(sim.dev_path()));
        }
 
        SECTION("get file descriptor")
@@ -169,7 +169,7 @@ TEST_CASE("stream insertion operator works for chip", "[chip]")
                            "\", label=\"foobar\", num_lines=4))";
 
                buf << chip;
-               REQUIRE_THAT(buf.str(), Catch::Equals(expected.str()));
+               REQUIRE_THAT(buf.str(), Catch::Matchers::Equals(expected.str()));
        }
 
        SECTION("closed chip")
index 19a6ab3bdcddf7cbc61b80755ce5e0461648f4e0..db387be24b89c54b4203a4c88b8d333e880796ec 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <chrono>
 #include <gpiod.hpp>
 #include <sstream>
index 21c0ef0013f3fa6ab5ce48aa2da94568dc2ecfa2..f7ae309c24981d74202de3a98d297371438f7717 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <chrono>
 #include <filesystem>
 #include <gpiod.hpp>
index 5e439a10336673ef5c838b80708f7ddeedeabfda..2f510fb87f54e4d05becdb1b79f30cb4b169d3b3 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <gpiod.hpp>
 
 #include "gpiosim.hpp"
index 21211f2392e91e96bb522d29e2d678c9083c3d7b..8589da3c6e22adc80208a206898e40b5b5fdedb0 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <gpiod.hpp>
 #include <string>
 
@@ -35,9 +35,9 @@ TEST_CASE("get_line_info() works", "[chip][line-info]")
                auto info = chip.get_line_info(0);
 
                REQUIRE(info.offset() == 0);
-               REQUIRE_THAT(info.name(), Catch::Equals("foobar"));
+               REQUIRE_THAT(info.name(), Catch::Matchers::Equals("foobar"));
                REQUIRE(info.used());
-               REQUIRE_THAT(info.consumer(), Catch::Equals("hog"));
+               REQUIRE_THAT(info.consumer(), Catch::Matchers::Equals("hog"));
                REQUIRE(info.direction() == ::gpiod::line::direction::OUTPUT);
                REQUIRE_FALSE(info.active_low());
                REQUIRE(info.bias() == ::gpiod::line::bias::UNKNOWN);
@@ -74,9 +74,9 @@ TEST_CASE("line properties can be retrieved", "[line-info]")
                auto info6 = chip.get_line_info(6);
 
                REQUIRE(info4.offset() == 4);
-               REQUIRE_THAT(info4.name(), Catch::Equals("baz"));
+               REQUIRE_THAT(info4.name(), Catch::Matchers::Equals("baz"));
                REQUIRE(info4.used());
-               REQUIRE_THAT(info4.consumer(), Catch::Equals("hog4"));
+               REQUIRE_THAT(info4.consumer(), Catch::Matchers::Equals("hog4"));
                REQUIRE(info4.direction() == direction::OUTPUT);
                REQUIRE(info4.edge_detection() == edge::NONE);
                REQUIRE_FALSE(info4.active_low());
@@ -102,10 +102,10 @@ TEST_CASE("line_info can be copied and moved")
        {
                auto copy(info);
                REQUIRE(copy.offset() == 2);
-               REQUIRE_THAT(copy.name(), Catch::Equals("foobar"));
+               REQUIRE_THAT(copy.name(), Catch::Matchers::Equals("foobar"));
                /* info can still be used */
                REQUIRE(info.offset() == 2);
-               REQUIRE_THAT(info.name(), Catch::Equals("foobar"));
+               REQUIRE_THAT(info.name(), Catch::Matchers::Equals("foobar"));
        }
 
        SECTION("assignment operator works")
@@ -113,17 +113,17 @@ TEST_CASE("line_info can be copied and moved")
                auto copy = chip.get_line_info(0);
                copy = info;
                REQUIRE(copy.offset() == 2);
-               REQUIRE_THAT(copy.name(), Catch::Equals("foobar"));
+               REQUIRE_THAT(copy.name(), Catch::Matchers::Equals("foobar"));
                /* info can still be used */
                REQUIRE(info.offset() == 2);
-               REQUIRE_THAT(info.name(), Catch::Equals("foobar"));
+               REQUIRE_THAT(info.name(), Catch::Matchers::Equals("foobar"));
        }
 
        SECTION("move constructor works")
        {
                auto copy(::std::move(info));
                REQUIRE(copy.offset() == 2);
-               REQUIRE_THAT(copy.name(), Catch::Equals("foobar"));
+               REQUIRE_THAT(copy.name(), Catch::Matchers::Equals("foobar"));
        }
 
        SECTION("move assignment operator works")
@@ -131,7 +131,7 @@ TEST_CASE("line_info can be copied and moved")
                auto copy = chip.get_line_info(0);
                copy = ::std::move(info);
                REQUIRE(copy.offset() == 2);
-               REQUIRE_THAT(copy.name(), Catch::Equals("foobar"));
+               REQUIRE_THAT(copy.name(), Catch::Matchers::Equals("foobar"));
        }
 }
 
index 9632ae0de6ab50a0197b533795ae26dce2ea9535..af8b979be2fae0ce9e566e43ce02baebf086beaa 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <gpiod.hpp>
 #include <sstream>
 #include <stdexcept>
@@ -20,7 +20,7 @@ using pull = ::gpiosim::chip::pull;
 
 namespace {
 
-class value_matcher : public Catch::MatcherBase<value>
+class value_matcher : public Catch::Matchers::MatcherBase<value>
 {
 public:
        value_matcher(pull pull, bool active_low = false)
@@ -117,7 +117,7 @@ TEST_CASE("consumer string is set correctly", "[line-request]")
                auto info = chip.get_line_info(2);
 
                REQUIRE(info.used());
-               REQUIRE_THAT(info.consumer(), Catch::Equals("foobar"));
+               REQUIRE_THAT(info.consumer(), Catch::Matchers::Equals("foobar"));
        }
 
        SECTION("empty consumer")
@@ -130,7 +130,7 @@ TEST_CASE("consumer string is set correctly", "[line-request]")
                auto info = chip.get_line_info(2);
 
                REQUIRE(info.used());
-               REQUIRE_THAT(info.consumer(), Catch::Equals("?"));
+               REQUIRE_THAT(info.consumer(), Catch::Matchers::Equals("?"));
        }
 }
 
@@ -380,7 +380,7 @@ TEST_CASE("line_request can be moved", "[line-request]")
                auto moved(::std::move(request));
 
                REQUIRE(moved.fd() == fd);
-               REQUIRE_THAT(moved.offsets(), Catch::Equals(offs));
+               REQUIRE_THAT(moved.offsets(), Catch::Matchers::Equals(offs));
        }
 
        SECTION("move assignment operator works")
@@ -388,7 +388,7 @@ TEST_CASE("line_request can be moved", "[line-request]")
                another = ::std::move(request);
 
                REQUIRE(another.fd() == fd);
-               REQUIRE_THAT(another.offsets(), Catch::Equals(offs));
+               REQUIRE_THAT(another.offsets(), Catch::Matchers::Equals(offs));
        }
 }
 
@@ -484,7 +484,7 @@ TEST_CASE("line_request stream insertion operator works", "[line-request]")
        {
                buf << request;
 
-               REQUIRE_THAT(buf.str(), Catch::Equals(expected.str()));
+               REQUIRE_THAT(buf.str(), Catch::Matchers::Equals(expected.str()));
        }
 
        SECTION("request released")
@@ -493,7 +493,7 @@ TEST_CASE("line_request stream insertion operator works", "[line-request]")
 
                buf << request;
 
-               REQUIRE_THAT(buf.str(), Catch::Equals("gpiod::line_request(released)"));
+               REQUIRE_THAT(buf.str(), Catch::Matchers::Equals("gpiod::line_request(released)"));
        }
 }
 
index dc821bb272d97fe5ff4ff97c7de9720fd0e3d120..2690331b502777d504acb3af6b4f0a11dd2c3376 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <gpiod.hpp>
 
 #include "helpers.hpp"
index 319012a6006349e0a039071203ff74d374b13129..abd0e0876238fec5e40886f40bda0a8cd2fdc0f4 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <gpiod.hpp>
 
 #include "helpers.hpp"
index f06dc3900822ddcecdadc066cab0df1fd251da99..33fc3faf029d7969f547f5c528abee6bd9f02020 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <filesystem>
 #include <gpiod.hpp>
 #include <string>
index 66eb748b99d0fb8c759e390c7894d9db55f755b6..d71e91b6a4b3ee6587c7e363ce6ea5ee09a59690 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 // SPDX-FileCopyrightText: 2021-2022 Bartosz Golaszewski <brgl@bgdev.pl>
 
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
 #include <cstddef>
 #include <gpiod.hpp>
 #include <string>
@@ -33,7 +33,7 @@ TEST_CASE("request_config can be moved", "[request-config]")
        SECTION("move constructor works")
        {
                auto moved(::std::move(cfg));
-               REQUIRE_THAT(moved.consumer(), Catch::Equals("foobar"));
+               REQUIRE_THAT(moved.consumer(), Catch::Matchers::Equals("foobar"));
                REQUIRE(moved.event_buffer_size() == 64);
        }
 
@@ -43,7 +43,7 @@ TEST_CASE("request_config can be moved", "[request-config]")
 
                moved = ::std::move(cfg);
 
-               REQUIRE_THAT(moved.consumer(), Catch::Equals("foobar"));
+               REQUIRE_THAT(moved.consumer(), Catch::Matchers::Equals("foobar"));
                REQUIRE(moved.event_buffer_size() == 64);
        }
 }
@@ -55,7 +55,7 @@ TEST_CASE("request_config mutators work", "[request-config]")
        SECTION("set consumer")
        {
                cfg.set_consumer("foobar");
-               REQUIRE_THAT(cfg.consumer(), Catch::Equals("foobar"));
+               REQUIRE_THAT(cfg.consumer(), Catch::Matchers::Equals("foobar"));
        }
 
        SECTION("set event_buffer_size")
@@ -77,7 +77,7 @@ TEST_CASE("request_config stream insertion operator works", "[request-config]")
 
        ::std::string expected("gpiod::request_config(consumer='foobar', event_buffer_size=32)");
 
-       REQUIRE_THAT(buf.str(), Catch::Equals(expected));
+       REQUIRE_THAT(buf.str(), Catch::Matchers::Equals(expected));
 }
 
 } /* namespace */
index a2370c5fa3e3ed83f6a33fcacb9509dd34aedec5..b86eee0a4756a42790d568d27424218ea080fcb8 100644 (file)
@@ -206,9 +206,10 @@ then
 
        if test "x$with_tests" = xtrue
        then
-               PKG_CHECK_MODULES([CATCH2], [catch2],, [
+               PKG_CHECK_MODULES([CATCH2], [catch2-with-main >= 3.0],, [
                        AC_LANG_PUSH([C++])
-                       AC_CHECK_HEADERS([catch2/catch.hpp], [], [HEADER_NOT_FOUND_CXX([catch2/catch.hpp])])
+                       AC_CHECK_HEADERS([catch2/catch_all.hpp], [],
+                                        [HEADER_NOT_FOUND_CXX([catch2/catch_all.hpp])])
                        AC_LANG_POP([C++])
                ])
        fi