1fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// Protocol Buffers - Google's data interchange format 2fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// Copyright 2008 Google Inc. All rights reserved. 3b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer// https://developers.google.com/protocol-buffers/ 4fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// 5fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// Redistribution and use in source and binary forms, with or without 6fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// modification, are permitted provided that the following conditions are 7fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// met: 8fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// 9fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// * Redistributions of source code must retain the above copyright 10fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// notice, this list of conditions and the following disclaimer. 11fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// * Redistributions in binary form must reproduce the above 12fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// copyright notice, this list of conditions and the following disclaimer 13fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// in the documentation and/or other materials provided with the 14fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// distribution. 15fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// * Neither the name of Google Inc. nor the names of its 16fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// contributors may be used to endorse or promote products derived from 17fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// this software without specific prior written permission. 18fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// 19fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer#include <google/protobuf/unittest_well_known_types.pb.h> 31fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville 32b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer#include <google/protobuf/stubs/common.h> 33b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer#include <google/protobuf/testing/googletest.h> 34b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer#include <gtest/gtest.h> 35b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer#include <google/protobuf/stubs/stl_util.h> 36fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville 37fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savillenamespace google { 38fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Savillenamespace protobuf { 39b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammernamespace { 40b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer 41b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer// This test only checks whether well-known types are included in protobuf 42b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer// runtime library. The test passes if it compiles. 43b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas BerghammerTEST(WellKnownTypesTest, AllKnownTypesAreIncluded) { 44b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer protobuf_unittest::TestWellKnownTypes message; 45b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.any_field().ByteSize()); 46b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.api_field().ByteSize()); 47b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.duration_field().ByteSize()); 48b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.empty_field().ByteSize()); 49b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.field_mask_field().ByteSize()); 50b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.source_context_field().ByteSize()); 51b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.struct_field().ByteSize()); 52b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.timestamp_field().ByteSize()); 53b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.type_field().ByteSize()); 54b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer EXPECT_EQ(0, message.int32_field().ByteSize()); 55b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer} 56fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville 57b0575e93e4c39dec69365b850088a1eb7f82c5b3Tamas Berghammer} // namespace 58fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville 59fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville} // namespace protobuf 60fbaaef999ba563838ebd00874ed8a1c01fbf286dWink Saville} // namespace google 61