• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <vector>
2 
3 #include "../src/benchmark_register.h"
4 #include "gmock/gmock.h"
5 #include "gtest/gtest.h"
6 
7 namespace {
8 
TEST(AddRangeTest,Simple)9 TEST(AddRangeTest, Simple) {
10   std::vector<int> dst;
11   AddRange(&dst, 1, 2, 2);
12   EXPECT_THAT(dst, testing::ElementsAre(1, 2));
13 }
14 
TEST(AddRangeTest,Simple64)15 TEST(AddRangeTest, Simple64) {
16   std::vector<int64_t> dst;
17   AddRange(&dst, static_cast<int64_t>(1), static_cast<int64_t>(2), 2);
18   EXPECT_THAT(dst, testing::ElementsAre(1, 2));
19 }
20 
TEST(AddRangeTest,Advanced)21 TEST(AddRangeTest, Advanced) {
22   std::vector<int> dst;
23   AddRange(&dst, 5, 15, 2);
24   EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15));
25 }
26 
TEST(AddRangeTest,Advanced64)27 TEST(AddRangeTest, Advanced64) {
28   std::vector<int64_t> dst;
29   AddRange(&dst, static_cast<int64_t>(5), static_cast<int64_t>(15), 2);
30   EXPECT_THAT(dst, testing::ElementsAre(5, 8, 15));
31 }
32 
33 }  // end namespace
34