Index: third_party/protobuf/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm |
diff --git a/third_party/protobuf/src/google/protobuf/testing/zcgunzip.cc b/third_party/protobuf/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm |
similarity index 54% |
copy from third_party/protobuf/src/google/protobuf/testing/zcgunzip.cc |
copy to third_party/protobuf/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm |
index a6197854bdef63dc11bbdf0b3cf1f7884348b0e3..9ba8fd0b906426d51a76112dbc9088b8157dc4a1 100644 |
--- a/third_party/protobuf/src/google/protobuf/testing/zcgunzip.cc |
+++ b/third_party/protobuf/objectivec/Tests/GPBObjectiveCPlusPlusTest.mm |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
-// Copyright 2009 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// Copyright 2013 Google Inc. All rights reserved. |
+// 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 |
@@ -28,46 +28,42 @@ |
// (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: brianolson@google.com (Brian Olson) |
-// Based on original Protocol Buffers design by |
-// Sanjay Ghemawat, Jeff Dean, and others. |
-// |
-// Test program to verify that GzipInputStream is compatible with command line |
-// gunzip or java.util.zip.GzipInputStream |
-// |
-// Reads gzip stream on standard input and writes decompressed data to standard |
-// output. |
-#include "config.h" |
+#import "GPBTestUtilities.h" |
-#include <assert.h> |
-#include <stdio.h> |
-#include <stdlib.h> |
-#include <fcntl.h> |
-#include <google/protobuf/io/gzip_stream.h> |
-#include <google/protobuf/io/zero_copy_stream_impl.h> |
+// |
+// This is just a compile test (here to make sure things never regress). |
+// |
+// Objective C++ can run into issues with how the NS_ENUM/CF_ENUM declartion |
+// works because of the C++ spec being used for that compilation unit. So |
+// the fact that these imports all work without errors/warning means things |
+// are still good. |
+// |
+// The "well know types" should have cross file enums needing imports. |
+#import "GPBProtocolBuffers.h" |
+// Some of the tests explicitly use cross file enums also. |
+#import "google/protobuf/Unittest.pbobjc.h" |
+#import "google/protobuf/UnittestImport.pbobjc.h" |
-using google::protobuf::io::FileInputStream; |
-using google::protobuf::io::GzipInputStream; |
+// Sanity check the conditions of the test within the Xcode project. |
+#if !__cplusplus |
+ #error This isn't compiled as Objective C++? |
+#elif __cplusplus >= 201103L |
+ // If this trips, it means the Xcode default might have change (or someone |
+ // edited the testing project) and it might be time to revisit the GPB_ENUM |
+ // define in GPBBootstrap.h. |
+ #warning Did the Xcode default for C++ spec change? |
+#endif |
-int main(int argc, const char** argv) { |
- FileInputStream fin(STDIN_FILENO); |
- GzipInputStream in(&fin); |
- while (true) { |
- const void* inptr; |
- int inlen; |
- bool ok; |
- ok = in.Next(&inptr, &inlen); |
- if (!ok) { |
- break; |
- } |
- if (inlen > 0) { |
- int err = write(STDOUT_FILENO, inptr, inlen); |
- assert(err == inlen); |
- } |
- } |
+// Dummy XCTest. |
+@interface GPBObjectiveCPlusPlusTests : GPBTestCase |
+@end |
- return 0; |
+@implementation GPBObjectiveCPlusPlusTests |
+- (void)testCPlusPlus { |
+ // Nothing, This was a compile test. |
+ XCTAssertTrue(YES); |
} |
+@end |