Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1524)

Unified Diff: third_party/protobuf/src/google/protobuf/arena_nc_test.py

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/arena_nc_test.py
diff --git a/third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py b/third_party/protobuf/src/google/protobuf/arena_nc_test.py
similarity index 64%
rename from third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py
rename to third_party/protobuf/src/google/protobuf/arena_nc_test.py
index 0d84b3207bdd0a5f5b7202e9ad67d6cfcf55e0d3..87a69b2afd76e6a81adb30e44d7703280535f600 100644
--- a/third_party/protobuf/python/google/protobuf/internal/message_cpp_test.py
+++ b/third_party/protobuf/src/google/protobuf/arena_nc_test.py
@@ -1,8 +1,8 @@
-#! /usr/bin/python
+#! /usr/bin/env python
#
# 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
@@ -30,16 +30,32 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Tests for google.protobuf.internal.message_cpp."""
+"""Negative compilation unit tests for arena API."""
-__author__ = 'shahms@google.com (Shahms King)'
-
-import os
-os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp'
+import unittest
+from google3.testing.pybase import fake_target_util
import unittest
-from google.protobuf.internal.message_test import *
+class ArenaNcTest(unittest.TestCase):
+
+ def testCompilerErrors(self):
+ """Runs a list of tests to verify compiler error messages."""
+
+ # Defines a list of test specs, where each element is a tuple
+ # (test name, list of regexes for matching the compiler errors).
+ test_specs = [
+ ('ARENA_PRIVATE_CONSTRUCTOR',
+ [r'calling a protected constructor']),
+ ('SANITY', None)]
+
+ fake_target_util.AssertCcCompilerErrors(
+ self, # The current test case.
+ 'google3/google/protobuf/arena_nc', # The fake target file.
+ 'arena_nc.o', # The sub-target to build.
+ test_specs # List of test specifications.
+ )
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « third_party/protobuf/src/google/protobuf/arena_nc.cc ('k') | third_party/protobuf/src/google/protobuf/arena_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698