mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[wpinet] Translate unit tests to catch2 (#8954)
This commit is contained in:
@@ -8,12 +8,13 @@
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "wpi/net/MulticastServiceAnnouncer.h"
|
||||
#include "wpi/net/MulticastServiceResolver.h"
|
||||
|
||||
TEST(MulticastServiceAnnouncerTest, EmptyText) {
|
||||
TEST_CASE("MulticastServiceAnnouncerTest EmptyText",
|
||||
"[multicast][service-discovery]") {
|
||||
const std::string_view serviceName = "TestServiceNoText";
|
||||
const std::string_view serviceType = "_wpinotxt._tcp";
|
||||
const int port = std::rand();
|
||||
@@ -37,14 +38,15 @@ TEST(MulticastServiceAnnouncerTest, EmptyText) {
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
}
|
||||
|
||||
ASSERT_GT(allData.size(), 0ul);
|
||||
REQUIRE(allData.size() > 0ul);
|
||||
|
||||
resolver.Stop();
|
||||
announcer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
TEST(MulticastServiceAnnouncerTest, SingleText) {
|
||||
TEST_CASE("MulticastServiceAnnouncerTest SingleText",
|
||||
"[multicast][service-discovery]") {
|
||||
const std::string_view serviceName = "TestServiceSingle";
|
||||
const std::string_view serviceType = "_wpitxt";
|
||||
const int port = std::rand();
|
||||
|
||||
Reference in New Issue
Block a user