Google OR-Tools
v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
elemental_matcher.h
Go to the documentation of this file.
1
// Copyright 2010-2025 Google LLC
2
// Licensed under the Apache License, Version 2.0 (the "License");
3
// you may not use this file except in compliance with the License.
4
// You may obtain a copy of the License at
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
8
// Unless required by applicable law or agreed to in writing, software
9
// distributed under the License is distributed on an "AS IS" BASIS,
10
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
// See the License for the specific language governing permissions and
12
// limitations under the License.
13
14
#ifndef ORTOOLS_MATH_OPT_ELEMENTAL_ELEMENTAL_MATCHER_H_
15
#define ORTOOLS_MATH_OPT_ELEMENTAL_ELEMENTAL_MATCHER_H_
16
17
#include <ostream>
18
19
#include "absl/base/attributes.h"
20
#include "
ortools/base/gmock.h
"
21
#include "
ortools/math_opt/elemental/elemental.h
"
22
#include "
ortools/math_opt/elemental/elemental_differencer.h
"
23
24
namespace
operations_research::math_opt
{
25
26
class
ElementalMatcher
{
27
public
:
28
using
is_gtest_matcher
= void;
29
30
explicit
ElementalMatcher
(
const
Elemental
& expected
31
ABSL_ATTRIBUTE_LIFETIME_BOUND,
32
const
ElementalDifferenceOptions
& options);
33
34
bool
MatchAndExplain
(
const
Elemental
& actual, std::ostream* os)
const
;
35
36
void
DescribeTo
(std::ostream* os)
const
;
37
38
void
DescribeNegationTo
(std::ostream* os)
const
;
39
40
private
:
41
const
Elemental
* expected_;
42
ElementalDifferenceOptions
options_;
43
};
44
45
inline
testing::Matcher<const Elemental&>
EquivToElemental
(
46
const
Elemental
& expected ABSL_ATTRIBUTE_LIFETIME_BOUND,
47
const
ElementalDifferenceOptions
& options = {}) {
48
return
ElementalMatcher(expected, options);
49
}
50
51
}
// namespace operations_research::math_opt
52
53
#endif
// ORTOOLS_MATH_OPT_ELEMENTAL_ELEMENTAL_MATCHER_H_
operations_research::math_opt::ElementalMatcher::ElementalMatcher
ElementalMatcher(const Elemental &expected ABSL_ATTRIBUTE_LIFETIME_BOUND, const ElementalDifferenceOptions &options)
Definition
elemental_matcher.cc:23
operations_research::math_opt::ElementalMatcher::is_gtest_matcher
void is_gtest_matcher
Definition
elemental_matcher.h:28
operations_research::math_opt::ElementalMatcher::DescribeTo
void DescribeTo(std::ostream *os) const
Definition
elemental_matcher.cc:41
operations_research::math_opt::ElementalMatcher::MatchAndExplain
bool MatchAndExplain(const Elemental &actual, std::ostream *os) const
Definition
elemental_matcher.cc:27
operations_research::math_opt::ElementalMatcher::DescribeNegationTo
void DescribeNegationTo(std::ostream *os) const
Definition
elemental_matcher.cc:45
operations_research::math_opt::Elemental
Definition
elemental.h:49
elemental.h
elemental_differencer.h
gmock.h
operations_research::math_opt
Definition
gurobi_isv.cc:28
operations_research::math_opt::EquivToElemental
testing::Matcher< const Elemental & > EquivToElemental(const Elemental &expected ABSL_ATTRIBUTE_LIFETIME_BOUND, const ElementalDifferenceOptions &options={})
Definition
elemental_matcher.h:45
operations_research::math_opt::ElementalDifferenceOptions
Definition
elemental_differencer.h:52
ortools
math_opt
elemental
elemental_matcher.h
Generated by
1.15.0