aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/testing/gtest_extensions/probe.h
diff options
context:
space:
mode:
authorbulatman <bulatman@yandex-team.ru>2022-02-10 16:45:50 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:50 +0300
commit6560e4993b14d193f8c879e33a3de5e5eba6e21d (patch)
treecfd2e2baa05c3196f2caacbb63c32e1df40bc3de /library/cpp/testing/gtest_extensions/probe.h
parent7489e4682331202b9c7d863c0898eb83d7b12c2b (diff)
downloadydb-6560e4993b14d193f8c879e33a3de5e5eba6e21d.tar.gz
Restoring authorship annotation for <bulatman@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing/gtest_extensions/probe.h')
-rw-r--r--library/cpp/testing/gtest_extensions/probe.h94
1 files changed, 47 insertions, 47 deletions
diff --git a/library/cpp/testing/gtest_extensions/probe.h b/library/cpp/testing/gtest_extensions/probe.h
index 7d1fee83d3..3b18502555 100644
--- a/library/cpp/testing/gtest_extensions/probe.h
+++ b/library/cpp/testing/gtest_extensions/probe.h
@@ -1,81 +1,81 @@
#pragma once
-#include <util/system/yassert.h>
+#include <util/system/yassert.h>
#include <library/cpp/testing/common/probe.h>
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <gmock/gmock.h>
namespace testing {
using NTesting::TProbe;
using NTesting::TProbeState;
using NTesting::TCoercibleToProbe;
- // A helper functor which extracts from probe-like objectss their state.
- struct TProbableTraits {
- static const TProbeState& ExtractState(const TProbeState& probe) {
- return probe;
- }
+ // A helper functor which extracts from probe-like objectss their state.
+ struct TProbableTraits {
+ static const TProbeState& ExtractState(const TProbeState& probe) {
+ return probe;
+ }
- static const TProbeState& ExtractState(const TProbeState* probe) {
- return *probe;
- }
+ static const TProbeState& ExtractState(const TProbeState* probe) {
+ return *probe;
+ }
- static const TProbeState& ExtractState(const TProbe& probe) {
- return *probe.State;
- }
+ static const TProbeState& ExtractState(const TProbe& probe) {
+ return *probe.State;
+ }
- static const TProbeState& ExtractState(const TCoercibleToProbe& probe) {
- return *probe.State;
- }
- };
+ static const TProbeState& ExtractState(const TCoercibleToProbe& probe) {
+ return *probe.State;
+ }
+ };
- void PrintTo(const TProbeState& state, ::std::ostream* os);
+ void PrintTo(const TProbeState& state, ::std::ostream* os);
- inline void PrintTo(const TProbe& probe, ::std::ostream* os) {
- PrintTo(TProbableTraits::ExtractState(probe), os);
+ inline void PrintTo(const TProbe& probe, ::std::ostream* os) {
+ PrintTo(TProbableTraits::ExtractState(probe), os);
}
- inline void PrintTo(const TCoercibleToProbe& probe, ::std::ostream* os) {
- PrintTo(TProbableTraits::ExtractState(probe), os);
+ inline void PrintTo(const TCoercibleToProbe& probe, ::std::ostream* os) {
+ PrintTo(TProbableTraits::ExtractState(probe), os);
}
- MATCHER(IsAlive, "is alive") {
- Y_UNUSED(result_listener);
+ MATCHER(IsAlive, "is alive") {
+ Y_UNUSED(result_listener);
const auto& state = TProbableTraits::ExtractState(arg);
- return state.Destructors < state.Constructors + state.CopyConstructors + state.CopyAssignments;
+ return state.Destructors < state.Constructors + state.CopyConstructors + state.CopyAssignments;
}
- MATCHER(IsDead, "is dead") {
- Y_UNUSED(result_listener);
+ MATCHER(IsDead, "is dead") {
+ Y_UNUSED(result_listener);
const auto& state = TProbableTraits::ExtractState(arg);
- return state.Destructors == state.Constructors + state.CopyConstructors + state.CopyAssignments;
+ return state.Destructors == state.Constructors + state.CopyConstructors + state.CopyAssignments;
}
- MATCHER_P2(HasCopyMoveCounts, copyCount, moveCount, "" + \
- PrintToString(copyCount) + " copy constructors and " + \
- PrintToString(moveCount) + " move constructors were called") {
- Y_UNUSED(result_listener);
+ MATCHER_P2(HasCopyMoveCounts, copyCount, moveCount, "" + \
+ PrintToString(copyCount) + " copy constructors and " + \
+ PrintToString(moveCount) + " move constructors were called") {
+ Y_UNUSED(result_listener);
const auto& state = TProbableTraits::ExtractState(arg);
- return state.CopyConstructors == copyCount && state.MoveConstructors == moveCount;
- }
+ return state.CopyConstructors == copyCount && state.MoveConstructors == moveCount;
+ }
- MATCHER(NoCopies, "no copies were made") {
- Y_UNUSED(result_listener);
+ MATCHER(NoCopies, "no copies were made") {
+ Y_UNUSED(result_listener);
const auto& state = TProbableTraits::ExtractState(arg);
- return 0 == state.CopyConstructors && 0 == state.CopyAssignments;
- }
+ return 0 == state.CopyConstructors && 0 == state.CopyAssignments;
+ }
- MATCHER(NoMoves, "no moves were made") {
- Y_UNUSED(result_listener);
+ MATCHER(NoMoves, "no moves were made") {
+ Y_UNUSED(result_listener);
const auto& state = TProbableTraits::ExtractState(arg);
- return 0 == state.MoveConstructors && 0 == state.MoveAssignments;
- }
+ return 0 == state.MoveConstructors && 0 == state.MoveAssignments;
+ }
- MATCHER(NoAssignments, "no assignments were made") {
- Y_UNUSED(result_listener);
+ MATCHER(NoAssignments, "no assignments were made") {
+ Y_UNUSED(result_listener);
const auto& state = TProbableTraits::ExtractState(arg);
- return 0 == state.CopyAssignments && 0 == state.MoveAssignments;
- }
+ return 0 == state.CopyAssignments && 0 == state.MoveAssignments;
+ }
}