32TEST(ContainsInOrderMatcher, CanDescribeItself)
35 ASSERT_EQ(::testing::DescribeMatcher<std::vector<int>>(matcher),
"contains in order elements that match (is equal to 3, is equal to 4)");
37 const auto matcher_not = ::testing::Not(
ContainsInOrder<int>(::testing::Eq(3), ::testing::Eq(4)));
38 ASSERT_EQ(::testing::DescribeMatcher<std::vector<int>>(matcher_not),
"does not contain in order elements that match (is equal to 3, is equal to 4)");
42TEST(ContainsInOrderMatcher, Matches)
44 const std::vector<int> vec{1, 2, 3, 4};
51TEST(ElementAtMatcher, CanDescribeItself)
54 ASSERT_EQ(::testing::DescribeMatcher<std::vector<int>>(matcher),
"element at index 42 is equal to 666");
56 const auto matcher_not = ::testing::Not(
ElementAt<int>(42, ::testing::Eq(666)));
57 ASSERT_EQ(::testing::DescribeMatcher<std::vector<int>>(matcher_not),
"element at index 42 isn't equal to 666");
61TEST(ElementAtMatcher, Matches)
63 const std::vector<int> vec{1, 2, 3, 4};
68 ASSERT_THAT(vec, ::testing::Not(
ElementAt<int>( 0, ::testing::Eq(2))));
69 ASSERT_THAT(vec, ::testing::Not(
ElementAt<int>(42, ::testing::Eq(2))));
75 const AllocDescriptor event{.kpsh = {.name =
"Cuda"}, .name =
"my-label", .ptr =
reinterpret_cast<void*
>(0x7ffee2b9d8f0), .size = 128};
77 const AllocDescriptor partial_match {.kpsh = {.name =
"Cuda"}, .name =
"my-label", .size = 128};
78 const AllocDescriptor partial_no_match_kpsh_name {.kpsh = {.name =
"osef"}, .name =
"my-label", .size = 128};
79 const AllocDescriptor partial_no_match_name {.kpsh = {.name =
"Cuda"}, .name =
"my-xxxxx", .size = 128};
80 const AllocDescriptor partial_no_match_size {.kpsh = {.name =
"Cuda"}, .name =
"my-label", .size = 129};
92 .dst =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-dst", .ptr =
reinterpret_cast<void*
>(0x7ffee2b9d8f0), .size = 128},
93 .src =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-src", .ptr =
reinterpret_cast<void*
>(0x7ffee2b9d8f0), .size = 128}
97 .dst =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-dst", .size = 128},
98 .src =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-src", .size = 128}
102 .dst =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-xxx", .size = 128},
103 .src =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-src", .size = 128}
107 .dst =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-dst", .size = 128},
108 .src =
AllocDescriptor{.kpsh = {.name =
"Cuda"}, .name =
"my-xxx", .size = 128}