| 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"
6 #include "impeller/core/buffer_view.h"
7
8 namespace impeller {
9 namespace testing {
10
11 TEST(BufferViewTest, Empty) {
12 BufferView buffer_view;
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
buffer_view
BufferView buffer_view
Definition: blit_command_gles.cc:152
buffer_view.h
impeller::DeviceBuffer
Definition: device_buffer.h:18
impeller::testing::TEST
TEST(AllocationSizeTest, CanCreateTypedAllocations)
Definition: allocation_size_unittests.cc:10
impeller
Definition: allocation.cc:12
impeller::BufferView
Definition: buffer_view.h:19