Flutter Impeller
buffer_view_unittests.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/testing/testing.h"
7 
8 namespace impeller {
9 namespace testing {
10 
11 TEST(BufferViewTest, Empty) {
13  EXPECT_FALSE(buffer_view);
14 }
15 
16 TEST(BufferViewTest, TakeRaw) {
17  DeviceBuffer* buffer = reinterpret_cast<DeviceBuffer*>(0xcafebabe);
18  BufferView buffer_view(buffer, {0, 123});
19  EXPECT_TRUE(buffer_view);
20  std::shared_ptr<const DeviceBuffer> taken = buffer_view.TakeBuffer();
21  EXPECT_FALSE(taken);
22  EXPECT_EQ(buffer_view.GetBuffer(), buffer);
23 }
24 
25 } // namespace testing
26 } // namespace impeller
BufferView buffer_view
TEST(AllocationSizeTest, CanCreateTypedAllocations)