2022-10-08 10:01:31 -07:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// 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.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <ostream>
|
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
|
|
#include "PubSubOptions.h"
|
|
|
|
|
#include "gmock/gmock.h"
|
|
|
|
|
|
|
|
|
|
namespace nt {
|
|
|
|
|
|
|
|
|
|
class PubSubOptionsMatcher
|
2022-12-12 19:28:15 -08:00
|
|
|
: public ::testing::MatcherInterface<const PubSubOptionsImpl&> {
|
2022-10-08 10:01:31 -07:00
|
|
|
public:
|
2022-12-12 19:28:15 -08:00
|
|
|
explicit PubSubOptionsMatcher(PubSubOptionsImpl good)
|
|
|
|
|
: good{std::move(good)} {}
|
2022-10-08 10:01:31 -07:00
|
|
|
|
2022-12-12 19:28:15 -08:00
|
|
|
bool MatchAndExplain(const PubSubOptionsImpl& val,
|
2022-10-08 10:01:31 -07:00
|
|
|
::testing::MatchResultListener* listener) const override;
|
|
|
|
|
void DescribeTo(::std::ostream* os) const override;
|
|
|
|
|
void DescribeNegationTo(::std::ostream* os) const override;
|
|
|
|
|
|
|
|
|
|
private:
|
2022-12-12 19:28:15 -08:00
|
|
|
PubSubOptionsImpl good;
|
2022-10-08 10:01:31 -07:00
|
|
|
};
|
|
|
|
|
|
2022-12-12 19:28:15 -08:00
|
|
|
inline ::testing::Matcher<const PubSubOptionsImpl&> PubSubOptionsEq(
|
|
|
|
|
PubSubOptionsImpl good) {
|
2022-10-08 10:01:31 -07:00
|
|
|
return ::testing::MakeMatcher(new PubSubOptionsMatcher(std::move(good)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace nt
|