mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
[cscore] Translate unit tests to catch2 (#8999)
This commit is contained in:
@@ -2,19 +2,14 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "wpi/cs/HttpCamera.hpp"
|
||||
#include "wpi/cs/cscore_cpp.hpp"
|
||||
|
||||
namespace wpi::cs {
|
||||
|
||||
class CameraSourceTest : public ::testing::Test {
|
||||
protected:
|
||||
CameraSourceTest() = default;
|
||||
};
|
||||
|
||||
TEST_F(CameraSourceTest, HTTPCamera) {
|
||||
TEST_CASE("CameraSourceTest HTTPCamera", "[cscore][camera-source]") {
|
||||
auto source = HttpCamera("camera", "http://localhost:8000");
|
||||
wpi::cs::Shutdown();
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
|
||||
#include "wpi/cs/RawSource.hpp"
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
namespace wpi::cs {
|
||||
|
||||
TEST(RawSourceTest, CreateEmpty) {
|
||||
TEST_CASE("RawSourceTest CreateEmpty", "[cscore][raw-source]") {
|
||||
RawSource source;
|
||||
}
|
||||
|
||||
TEST(RawSourceTest, Create) {
|
||||
TEST_CASE("RawSourceTest Create", "[cscore][raw-source]") {
|
||||
RawSource source("test", wpi::util::PixelFormat::BGR, 640, 480, 30);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <catch2/catch_session.hpp>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
int ret = RUN_ALL_TESTS();
|
||||
return ret;
|
||||
return Catch::Session().run(argc, argv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user