// Copyright 2019 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/containers/any_internal.h" #include "testing/gtest/include/gtest/gtest.h" namespace base { namespace internal { namespace { struct OutOfLineStruct { void* one; void* two; void* three; void* four; }; } // namespace TEST(AnyInternalTest, InlineOrOutlineStorage) { static_assert(AnyInternal::InlineStorageHelper::kUseInlineStorage, "int should be stored inline"); static_assert(AnyInternal::InlineStorageHelper::kUseInlineStorage, "int* should be stored inline"); static_assert( AnyInternal::InlineStorageHelper>::kUseInlineStorage, "std::unique_ptr should be stored inline"); static_assert( !AnyInternal::InlineStorageHelper::kUseInlineStorage, "A struct with four pointers should be stored out of line"); } } // namespace internal } // namespace base