• Home
  • Raw
  • Download

Lines Matching refs:UNIT

125 #define TEST_DURATION_CONVERSION(UNIT)                                  \  in TEST()  argument
127 const absl::Duration d = absl::UNIT(1.5); \ in TEST()
131 EXPECT_EQ(kint64min, absl::ToInt64##UNIT(-inf)); \ in TEST()
132 EXPECT_EQ(-1, absl::ToInt64##UNIT(-d)); \ in TEST()
133 EXPECT_EQ(0, absl::ToInt64##UNIT(z)); \ in TEST()
134 EXPECT_EQ(1, absl::ToInt64##UNIT(d)); \ in TEST()
135 EXPECT_EQ(kint64max, absl::ToInt64##UNIT(inf)); \ in TEST()
136 EXPECT_EQ(-dbl_inf, absl::ToDouble##UNIT(-inf)); \ in TEST()
137 EXPECT_EQ(-1.5, absl::ToDouble##UNIT(-d)); \ in TEST()
138 EXPECT_EQ(0, absl::ToDouble##UNIT(z)); \ in TEST()
139 EXPECT_EQ(1.5, absl::ToDouble##UNIT(d)); \ in TEST()
140 EXPECT_EQ(dbl_inf, absl::ToDouble##UNIT(inf)); \ in TEST()
860 #define TEST_REL_OPS(UNIT) \ in TEST() argument
861 static_assert(UNIT(2) == UNIT(2), ""); \ in TEST()
862 static_assert(UNIT(1) != UNIT(2), ""); \ in TEST()
863 static_assert(UNIT(1) < UNIT(2), ""); \ in TEST()
864 static_assert(UNIT(3) > UNIT(2), ""); \ in TEST()
865 static_assert(UNIT(1) <= UNIT(2), ""); \ in TEST()
866 static_assert(UNIT(2) <= UNIT(2), ""); \ in TEST()
867 static_assert(UNIT(3) >= UNIT(2), ""); \ in TEST()
868 static_assert(UNIT(2) >= UNIT(2), ""); in TEST()
881 #define TEST_ADD_OPS(UNIT) \ in TEST() argument
883 EXPECT_EQ(UNIT(2), UNIT(1) + UNIT(1)); \ in TEST()
884 EXPECT_EQ(UNIT(1), UNIT(2) - UNIT(1)); \ in TEST()
885 EXPECT_EQ(UNIT(0), UNIT(2) - UNIT(2)); \ in TEST()
886 EXPECT_EQ(UNIT(-1), UNIT(1) - UNIT(2)); \ in TEST()
887 EXPECT_EQ(UNIT(-2), UNIT(0) - UNIT(2)); \ in TEST()
888 EXPECT_EQ(UNIT(-2), UNIT(1) - UNIT(3)); \ in TEST()
889 absl::Duration a = UNIT(1); \ in TEST()
890 a += UNIT(1); \ in TEST()
891 EXPECT_EQ(UNIT(2), a); \ in TEST()
892 a -= UNIT(1); \ in TEST()
893 EXPECT_EQ(UNIT(1), a); \ in TEST()
991 #define TEST_MUL_OPS(UNIT) \ in TEST() argument
993 EXPECT_EQ(UNIT(5), UNIT(2) * 2.5); \ in TEST()
994 EXPECT_EQ(UNIT(2), UNIT(5) / 2.5); \ in TEST()
995 EXPECT_EQ(UNIT(-5), UNIT(-2) * 2.5); \ in TEST()
996 EXPECT_EQ(UNIT(-5), -UNIT(2) * 2.5); \ in TEST()
997 EXPECT_EQ(UNIT(-5), UNIT(2) * -2.5); \ in TEST()
998 EXPECT_EQ(UNIT(-2), UNIT(-5) / 2.5); \ in TEST()
999 EXPECT_EQ(UNIT(-2), -UNIT(5) / 2.5); \ in TEST()
1000 EXPECT_EQ(UNIT(-2), UNIT(5) / -2.5); \ in TEST()
1001 EXPECT_EQ(UNIT(2), UNIT(11) % UNIT(3)); \ in TEST()
1002 absl::Duration a = UNIT(2); \ in TEST()
1004 EXPECT_EQ(UNIT(5), a); \ in TEST()
1006 EXPECT_EQ(UNIT(2), a); \ in TEST()
1007 a %= UNIT(1); \ in TEST()
1008 EXPECT_EQ(UNIT(0), a); \ in TEST()
1009 absl::Duration big = UNIT(1000000000); \ in TEST()
1012 EXPECT_EQ(UNIT(1000000000), big); \ in TEST()
1013 EXPECT_EQ(-UNIT(2), -UNIT(2)); \ in TEST()
1014 EXPECT_EQ(-UNIT(2), UNIT(2) * -1); \ in TEST()
1015 EXPECT_EQ(-UNIT(2), -1 * UNIT(2)); \ in TEST()
1016 EXPECT_EQ(-UNIT(-2), UNIT(2)); \ in TEST()
1017 EXPECT_EQ(2, UNIT(2) / UNIT(1)); \ in TEST()
1019 EXPECT_EQ(2, absl::IDivDuration(UNIT(2), UNIT(1), &rem)); \ in TEST()
1020 EXPECT_EQ(2.0, absl::FDivDuration(UNIT(2), UNIT(1))); \ in TEST()