[ntcore] NetworkTables 4 (#3217)

This commit is contained in:
Peter Johnson
2022-10-08 10:01:31 -07:00
committed by GitHub
parent 90cfa00115
commit 77301b126c
380 changed files with 34573 additions and 22095 deletions

View File

@@ -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_