unittest_import.proto 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. // Author: kenton@google.com (Kenton Varda)
  8. // Based on original Protocol Buffers design by
  9. // Sanjay Ghemawat, Jeff Dean, and others.
  10. //
  11. // A proto file which is imported by unittest.proto to test importing.
  12. syntax = "proto2";
  13. // We don't put this in a package within proto2 because we need to make sure
  14. // that the generated code doesn't depend on being in the proto2 namespace.
  15. // In test_util.h we do
  16. // "using namespace unittest_import = protobuf_unittest_import".
  17. package protobuf_unittest_import;
  18. option optimize_for = SPEED;
  19. option cc_enable_arenas = true;
  20. // Exercise the java_package option.
  21. option java_package = "com.google.protobuf.test";
  22. // Do not set a java_outer_classname here to verify that Proto2 works without
  23. // one.
  24. // Test public import
  25. import public "google/protobuf/unittest_import_public.proto";
  26. message ImportMessage {
  27. optional int32 d = 1;
  28. }
  29. enum ImportEnum {
  30. IMPORT_FOO = 7;
  31. IMPORT_BAR = 8;
  32. IMPORT_BAZ = 9;
  33. }
  34. // To use an enum in a map, it must has the first value as 0.
  35. enum ImportEnumForMap {
  36. UNKNOWN = 0;
  37. FOO = 1;
  38. BAR = 2;
  39. }