jami
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] tests: Skip tests that need Internet when there's none.


From: Maxim Cournoyer
Subject: [PATCH 2/2] tests: Skip tests that need Internet when there's none.
Date: Tue, 9 Jan 2024 11:19:44 -0500

* tests/unittests/messageparser_unittest.cpp (ALinkIsParsedCorrectly)
(YoutubeLinkIsParsedCorrectly): Skip when there is no Internet.

Fixes: <https://git.jami.net/savoirfairelinux/jami-client-qt/-/issues/1507>
---

 tests/unittests/messageparser_unittest.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/unittests/messageparser_unittest.cpp 
b/tests/unittests/messageparser_unittest.cpp
index c10b0d0b..df7a0692 100644
--- a/tests/unittests/messageparser_unittest.cpp
+++ b/tests/unittests/messageparser_unittest.cpp
@@ -69,6 +69,9 @@ TEST_F(MessageParserFixture, TextIsParsedCorrectly)
  */
 TEST_F(MessageParserFixture, ALinkIsParsedCorrectly)
 {
+    if (!globalEnv.connectivityMonitor->isOnline())
+        GTEST_SKIP() << "ALinkIsParsedCorrectly requires Internet 
connectivity";
+
     auto linkColor = QColor::fromRgb(0, 0, 255);
     auto backgroundColor = QColor::fromRgb(0, 0, 255);
 
@@ -174,6 +177,9 @@ TEST_F(MessageParserFixture, FencedCodeIsParsedCorrectly)
  */
 TEST_F(MessageParserFixture, YoutubeLinkIsParsedCorrectly)
 {
+    if (!globalEnv.connectivityMonitor->isOnline())
+        GTEST_SKIP() << "YoutubeLinkIsParsedCorrectly requires Internet 
connectivity";
+
     auto url = "https://www.youtube.com/watch?v=1234567890";;
     auto msg = "blah blah " + QString(url) + " blah blah";
 
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]