Skip to content

Commit f65cee4

Browse files
laramielcopybara-github
authored andcommitted
Fix test expectations on some compilers
PiperOrigin-RevId: 845068227 Change-Id: I783f9a10aa573e1cbe1d045d5851e4e72ccdc685
1 parent 534afff commit f65cee4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tensorstore/internal/metrics/collect_test.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ using ::tensorstore::internal_metrics::FormatCollectedMetric;
3939
using ::tensorstore::internal_metrics::IsCollectedMetricNonZero;
4040
using ::tensorstore::internal_metrics::Units;
4141
using ::testing::ElementsAre;
42+
using ::testing::Eq;
4243
using ::testing::Pair;
44+
using ::testing::VariantWith;
4345

4446
TEST(CollectTest, IsCollectedMetricNonZero) {
4547
CollectedMetric metric;
@@ -287,10 +289,10 @@ TEST(CollectTest, CollectedMetricDeltaSizeMismatch) {
287289
EXPECT_EQ("a", c.metric_name);
288290

289291
ASSERT_EQ(2, c.values.size());
290-
EXPECT_THAT(c.values[0].value, 2);
291-
EXPECT_THAT(c.values[0].max_value, 10);
292-
EXPECT_THAT(c.values[1].value, 13);
293-
EXPECT_THAT(c.values[1].max_value, 111);
292+
EXPECT_THAT(c.values[0].value, VariantWith<int64_t>(Eq(2)));
293+
EXPECT_THAT(c.values[0].max_value, VariantWith<int64_t>(Eq(10)));
294+
EXPECT_THAT(c.values[1].value, VariantWith<int64_t>(Eq(13)));
295+
EXPECT_THAT(c.values[1].max_value, VariantWith<int64_t>(Eq(111)));
294296

295297
ASSERT_EQ(1, c.histograms.size());
296298
EXPECT_EQ(5, c.histograms[0].count);

0 commit comments

Comments
 (0)