| Index: third_party/protobuf/src/google/protobuf/well_known_types_unittest.cc
|
| diff --git a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h b/third_party/protobuf/src/google/protobuf/well_known_types_unittest.cc
|
| similarity index 63%
|
| copy from third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h
|
| copy to third_party/protobuf/src/google/protobuf/well_known_types_unittest.cc
|
| index 787706629bd10fc72eb7811d9498f19dd0524d11..c9a9aa10ec18a7b9204fc59dc1b48eef55d3ace7 100644
|
| --- a/third_party/protobuf/src/google/protobuf/compiler/cpp/cpp_options.h
|
| +++ b/third_party/protobuf/src/google/protobuf/well_known_types_unittest.cc
|
| @@ -1,6 +1,6 @@
|
| // Protocol Buffers - Google's data interchange format
|
| // Copyright 2008 Google Inc. All rights reserved.
|
| -// http://code.google.com/p/protobuf/
|
| +// https://developers.google.com/protocol-buffers/
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -27,32 +27,34 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| -
|
| -// Author: rennie@google.com (Jeffrey Rennie)
|
| -
|
| -#ifndef GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__
|
| -#define GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__
|
| -
|
| -#include <string>
|
| +#include <google/protobuf/unittest_well_known_types.pb.h>
|
|
|
| #include <google/protobuf/stubs/common.h>
|
| +#include <google/protobuf/testing/googletest.h>
|
| +#include <gtest/gtest.h>
|
| +#include <google/protobuf/stubs/stl_util.h>
|
| +
|
| namespace google {
|
| namespace protobuf {
|
| -namespace compiler {
|
| -namespace cpp {
|
| +namespace {
|
| +
|
| +// This test only checks whether well-known types are included in protobuf
|
| +// runtime library. The test passes if it compiles.
|
| +TEST(WellKnownTypesTest, AllKnownTypesAreIncluded) {
|
| + protobuf_unittest::TestWellKnownTypes message;
|
| + EXPECT_EQ(0, message.any_field().ByteSize());
|
| + EXPECT_EQ(0, message.api_field().ByteSize());
|
| + EXPECT_EQ(0, message.duration_field().ByteSize());
|
| + EXPECT_EQ(0, message.empty_field().ByteSize());
|
| + EXPECT_EQ(0, message.field_mask_field().ByteSize());
|
| + EXPECT_EQ(0, message.source_context_field().ByteSize());
|
| + EXPECT_EQ(0, message.struct_field().ByteSize());
|
| + EXPECT_EQ(0, message.timestamp_field().ByteSize());
|
| + EXPECT_EQ(0, message.type_field().ByteSize());
|
| + EXPECT_EQ(0, message.int32_field().ByteSize());
|
| +}
|
| +
|
| +} // namespace
|
|
|
| -// Generator options:
|
| -struct Options {
|
| - Options() : safe_boundary_check(false) {
|
| - }
|
| - string dllexport_decl;
|
| - bool safe_boundary_check;
|
| -};
|
| -
|
| -} // namespace cpp
|
| -} // namespace compiler
|
| } // namespace protobuf
|
| -
|
| -
|
| } // namespace google
|
| -#endif // GOOGLE_PROTOBUF_COMPILER_CPP_OPTIONS_H__
|
|
|