mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[ntcore] NetworkTables 4 (#3217)
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
// 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.
|
||||
|
||||
#ifndef NTCORE_VALUEMATCHER_H_
|
||||
#define NTCORE_VALUEMATCHER_H_
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
@@ -14,26 +13,21 @@
|
||||
|
||||
namespace nt {
|
||||
|
||||
class ValueMatcher
|
||||
: public ::testing::MatcherInterface<std::shared_ptr<Value>> {
|
||||
class ValueMatcher : public ::testing::MatcherInterface<Value> {
|
||||
public:
|
||||
explicit ValueMatcher(std::shared_ptr<Value> goodval_)
|
||||
: goodval(std::move(goodval_)) {}
|
||||
explicit ValueMatcher(Value goodval_) : goodval(std::move(goodval_)) {}
|
||||
|
||||
bool MatchAndExplain(std::shared_ptr<Value> msg,
|
||||
bool MatchAndExplain(Value msg,
|
||||
::testing::MatchResultListener* listener) const override;
|
||||
void DescribeTo(::std::ostream* os) const override;
|
||||
void DescribeNegationTo(::std::ostream* os) const override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Value> goodval;
|
||||
Value goodval;
|
||||
};
|
||||
|
||||
inline ::testing::Matcher<std::shared_ptr<Value>> ValueEq(
|
||||
std::shared_ptr<Value> goodval) {
|
||||
inline ::testing::Matcher<Value> ValueEq(const Value& goodval) {
|
||||
return ::testing::MakeMatcher(new ValueMatcher(goodval));
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
|
||||
#endif // NTCORE_VALUEMATCHER_H_
|
||||
|
||||
Reference in New Issue
Block a user