Commit 2b3d1eb9 authored by andersca@apple.com's avatar andersca@apple.com

The style checker shouldn't complain about returning or passing OwnPtr

https://bugs.webkit.org/show_bug.cgi?id=121163

Reviewed by Antti Koivisto.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_function_definition_and_pass_ptr):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(PassPtrTest.test_pass_ref_ptr_return_value):
(PassPtrTest.test_own_ptr_parameter_value):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155535 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 888b8c1d
2013-09-11 Anders Carlsson <andersca@apple.com>
The style checker shouldn't complain about returning or passing OwnPtr
https://bugs.webkit.org/show_bug.cgi?id=121163
Reviewed by Antti Koivisto.
* Scripts/webkitpy/style/checkers/cpp.py:
(check_function_definition_and_pass_ptr):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(PassPtrTest.test_pass_ref_ptr_return_value):
(PassPtrTest.test_own_ptr_parameter_value):
2013-09-11 Mario Sanchez Prada <mario.prada@samsung.com>
[GTK] Remove Gail dependency from build system for GTK3
......
......@@ -1639,8 +1639,8 @@ def check_function_definition_and_pass_ptr(type_text, row, location_description,
location_description: Used to indicate where the type is. This is either 'parameter' or 'return'.
error: The function to call with any errors found.
"""
match_ref_or_own_ptr = '(?=\W|^)(Ref|Own)Ptr(?=\W)'
bad_type_usage = search(match_ref_or_own_ptr, type_text)
match_ref_ptr = '(?=\W|^)RefPtr(?=\W)'
bad_type_usage = search(match_ref_ptr, type_text)
if not bad_type_usage or type_text.endswith('&') or type_text.endswith('*'):
return
type_name = bad_type_usage.group(0)
......
......@@ -3445,7 +3445,7 @@ class PassPtrTest(CppStyleTestBase):
'OwnPtr<Type1> myFunction(int)\n'
'{\n'
'}',
'The return type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5]')
'')
def test_ref_ptr_parameter_value(self):
self.assert_pass_ptr_check(
......@@ -3479,7 +3479,7 @@ class PassPtrTest(CppStyleTestBase):
'int myFunction(OwnPtr<Type1>)\n'
'{\n'
'}',
'The parameter type should use PassOwnPtr instead of OwnPtr. [readability/pass_ptr] [5]')
'')
self.assert_pass_ptr_check(
'int myFunction(OwnPtr<Type1>& simple)\n'
'{\n'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment