Skip to content

Commit 2926f49

Browse files
committed
Fixes unit test: SetEmptyArrayAttribute
1 parent 34edd62 commit 2926f49

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

exporters/otlp/test/otlp_recordable_test.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,11 @@ TYPED_TEST(EmptyArrayAttributeTest, SetEmptyArrayAttribute)
544544
nostd::span<const ArrayElementType> span = {};
545545
rec.SetAttribute("empty_arr_attr", span);
546546

547-
EXPECT_TRUE(rec.span().attributes(0).value().has_array_value());
547+
constexpr const bool is_bytes_type = std::is_same<ArrayElementType, uint8_t>::value;
548+
EXPECT_NE(rec.span().attributes(0).value().has_array_value(), is_bytes_type);
549+
EXPECT_EQ(rec.span().attributes(0).value().has_bytes_value(), is_bytes_type);
548550
EXPECT_TRUE(rec.span().attributes(0).value().array_value().values().empty());
551+
EXPECT_TRUE(rec.span().attributes(0).value().bytes_value().empty());
549552
}
550553

551554
/**

0 commit comments

Comments
 (0)