#include "base/no_destructor.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/atomicops.h"
#include "base/barrier_closure.h"
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/system/sys_info.h"
#include "base/threading/platform_thread.h"
#include "base/threading/simple_thread.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
static_assert …;
static_assert …;
struct CheckOnDestroy { … };
TEST(NoDestructorTest, SkipsDestructors) { … }
struct UncopyableUnmovable { … };
struct CopyOnly { … };
struct MoveOnly { … };
struct ForwardingTestStruct { … };
TEST(NoDestructorTest, UncopyableUnmovable) { … }
TEST(NoDestructorTest, ForwardsArguments) { … }
TEST(NoDestructorTest, Accessors) { … }
#if !defined(COMPILER_GCC) && !defined(__clang__)
TEST(NoDestructorTest, InitializerList) {
static NoDestructor<std::vector<std::string>> vector({"a", "b", "c"});
}
#endif
}
namespace {
class BlockingConstructor { … };
subtle::Atomic32 BlockingConstructor::constructor_called_ = …;
subtle::Atomic32 BlockingConstructor::complete_construction_ = …;
class BlockingConstructorThread : public SimpleThread { … };
}
TEST(NoDestructorTest, PriorityInversionAtStaticInitializationResolves) { … }
}