unittest_optimize_for.proto 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // Additional options required for C# generation. File from copyright
  2. // line onwards is as per original distribution.
  3. import "google/protobuf/csharp_options.proto";
  4. import "google/protobuf/descriptor.proto";
  5. option (google.protobuf.CSharpFileOptions.csharp_options).namespace = "Google.ProtocolBuffers.TestProtos";
  6. option (google.protobuf.CSharpFileOptions.csharp_options).umbrella_classname = "UnitTestOptimizeForProtoFile";
  7. // Protocol Buffers - Google's data interchange format
  8. // Copyright 2008 Google Inc. All rights reserved.
  9. // http://code.google.com/p/protobuf/
  10. //
  11. // Redistribution and use in source and binary forms, with or without
  12. // modification, are permitted provided that the following conditions are
  13. // met:
  14. //
  15. // * Redistributions of source code must retain the above copyright
  16. // notice, this list of conditions and the following disclaimer.
  17. // * Redistributions in binary form must reproduce the above
  18. // copyright notice, this list of conditions and the following disclaimer
  19. // in the documentation and/or other materials provided with the
  20. // distribution.
  21. // * Neither the name of Google Inc. nor the names of its
  22. // contributors may be used to endorse or promote products derived from
  23. // this software without specific prior written permission.
  24. //
  25. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  26. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  27. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  28. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  29. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  30. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  31. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  32. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  33. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  34. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  35. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  36. // Author: kenton@google.com (Kenton Varda)
  37. // Based on original Protocol Buffers design by
  38. // Sanjay Ghemawat, Jeff Dean, and others.
  39. //
  40. // A proto file which uses optimize_for = CODE_SIZE.
  41. import "google/protobuf/unittest.proto";
  42. package protobuf_unittest;
  43. option optimize_for = CODE_SIZE;
  44. message TestOptimizedForSize {
  45. optional int32 i = 1;
  46. optional ForeignMessage msg = 19;
  47. extensions 1000 to max;
  48. extend TestOptimizedForSize {
  49. optional int32 test_extension = 1234;
  50. optional TestRequiredOptimizedForSize test_extension2 = 1235;
  51. }
  52. }
  53. message TestRequiredOptimizedForSize {
  54. required int32 x = 1;
  55. }
  56. message TestOptionalOptimizedForSize {
  57. optional TestRequiredOptimizedForSize o = 1;
  58. }