commit | d99af036634c3dc612d18042465bfcc45203fffc | [log] [tgz] |
---|---|---|
author | Ben Clayton <bclayton@google.com> | Fri May 20 09:03:50 2022 +0000 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri May 20 09:03:50 2022 +0000 |
tree | 92434ee27bc926d009e7746f1da06af11b39657c | |
parent | 3607cb84656226dc195a1db14b67078fcab7d3ff [diff] [blame] |
tint: Add utils::UniqueVector::data() Change-Id: Ibbd4f595c5fdaacf93c13757878ed06675e735c6 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/91022 Commit-Queue: Ben Clayton <bclayton@chromium.org> Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/tint/utils/unique_vector_test.cc b/src/tint/utils/unique_vector_test.cc index 7d586e9..035ebf8 100644 --- a/src/tint/utils/unique_vector_test.cc +++ b/src/tint/utils/unique_vector_test.cc
@@ -139,5 +139,14 @@ EXPECT_EQ(unique_vec.empty(), true); } +TEST(UniqueVectorTest, Data) { + UniqueVector<int> unique_vec; + EXPECT_EQ(unique_vec.data(), nullptr); + + unique_vec.add(42); + EXPECT_EQ(unique_vec.data(), &unique_vec[0]); + EXPECT_EQ(*unique_vec.data(), 42); +} + } // namespace } // namespace tint::utils