mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[ntcore] NetworkTables 4 (#3217)
This commit is contained in:
42
ntcore/src/test/native/cpp/PubSubOptionsMatcher.cpp
Normal file
42
ntcore/src/test/native/cpp/PubSubOptionsMatcher.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
// 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.
|
||||
|
||||
#include "PubSubOptionsMatcher.h"
|
||||
|
||||
#include "TestPrinters.h"
|
||||
|
||||
namespace nt {
|
||||
|
||||
bool PubSubOptionsMatcher::MatchAndExplain(
|
||||
const PubSubOptions& val, ::testing::MatchResultListener* listener) const {
|
||||
bool match = true;
|
||||
if (val.periodic != good.periodic) {
|
||||
*listener << "periodic mismatch ";
|
||||
match = false;
|
||||
}
|
||||
if (val.pollStorageSize != good.pollStorageSize) {
|
||||
*listener << "pollStorageSize mismatch ";
|
||||
match = false;
|
||||
}
|
||||
if (val.sendAll != good.sendAll) {
|
||||
*listener << "logging mismatch ";
|
||||
match = false;
|
||||
}
|
||||
if (val.keepDuplicates != good.keepDuplicates) {
|
||||
*listener << "keepDuplicates mismatch ";
|
||||
match = false;
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
void PubSubOptionsMatcher::DescribeTo(::std::ostream* os) const {
|
||||
PrintTo(good, os);
|
||||
}
|
||||
|
||||
void PubSubOptionsMatcher::DescribeNegationTo(::std::ostream* os) const {
|
||||
*os << "is not equal to ";
|
||||
PrintTo(good, os);
|
||||
}
|
||||
|
||||
} // namespace nt
|
||||
Reference in New Issue
Block a user