1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 #include <type_traits>
8
9 #include <gtest/gtest.h>
10 #include "google/protobuf/arena.h"
11 #include "google/protobuf/unittest.pb.h"
12
13 namespace google {
14 namespace protobuf {
15 namespace {
16
17 using protobuf_unittest::TestAllTypes;
18
TEST(MessageConstructorTest,RegularCtor)19 TEST(MessageConstructorTest, RegularCtor) {
20 using T = protobuf_unittest::TestAllTypes;
21 EXPECT_TRUE((std::is_constructible<T>::value));
22 }
23
TEST(MessageConstructorTest,RegularCopyCtor)24 TEST(MessageConstructorTest, RegularCopyCtor) {
25 using T = protobuf_unittest::TestAllTypes;
26 EXPECT_TRUE((std::is_constructible<T, const T&>::value));
27 }
28
TEST(MessageConstructorTest,ArenaCtor)29 TEST(MessageConstructorTest, ArenaCtor) {
30 using T = protobuf_unittest::TestAllTypes;
31 EXPECT_FALSE((std::is_constructible<T, Arena*>::value));
32 }
33
TEST(MessageConstructorTest,ArenaCopyCtor)34 TEST(MessageConstructorTest, ArenaCopyCtor) {
35 using T = protobuf_unittest::TestAllTypes;
36 EXPECT_FALSE((std::is_constructible<T, Arena*, const T&>::value));
37 }
38
39 } // namespace
40 } // namespace protobuf
41 } // namespace google
42