OLD | NEW |
1 # -*- coding: utf-8; -*- | 1 # -*- coding: utf-8; -*- |
2 # | 2 # |
3 # Copyright (C) 2011 Google Inc. All rights reserved. | 3 # Copyright (C) 2011 Google Inc. All rights reserved. |
4 # Copyright (C) 2009 Torch Mobile Inc. | 4 # Copyright (C) 2009 Torch Mobile Inc. |
5 # Copyright (C) 2009 Apple Inc. All rights reserved. | 5 # Copyright (C) 2009 Apple Inc. All rights reserved. |
6 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) | 6 # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org) |
7 # | 7 # |
8 # Redistribution and use in source and binary forms, with or without | 8 # Redistribution and use in source and binary forms, with or without |
9 # modification, are permitted provided that the following conditions are | 9 # modification, are permitted provided that the following conditions are |
10 # met: | 10 # met: |
(...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3626 'PassRefPtr<Type1> myFunction(int)\n' | 3626 'PassRefPtr<Type1> myFunction(int)\n' |
3627 '{\n' | 3627 '{\n' |
3628 '}', | 3628 '}', |
3629 '') | 3629 '') |
3630 self.assert_pass_ptr_check( | 3630 self.assert_pass_ptr_check( |
3631 'PassRefPtr<Type1> myFunction();\n', | 3631 'PassRefPtr<Type1> myFunction();\n', |
3632 '') | 3632 '') |
3633 self.assert_pass_ptr_check( | 3633 self.assert_pass_ptr_check( |
3634 'OwnRefPtr<Type1> myFunction();\n', | 3634 'OwnRefPtr<Type1> myFunction();\n', |
3635 '') | 3635 '') |
3636 self.assert_pass_ptr_check( | |
3637 'RefPtr<Type1> myFunction(int)\n' | |
3638 '{\n' | |
3639 '}', | |
3640 'The return type should use PassRefPtr instead of RefPtr. [readabil
ity/pass_ptr] [5]') | |
3641 self.assert_pass_ptr_check( | |
3642 'OwnPtr<Type1> myFunction(int)\n' | |
3643 '{\n' | |
3644 '}', | |
3645 'The return type should use PassOwnPtr instead of OwnPtr. [readabil
ity/pass_ptr] [5]') | |
3646 self.assert_pass_ptr_check( | |
3647 'RefPtrWillBeRawPtr<Type1> myFunction(int)\n' | |
3648 '{\n' | |
3649 '}', | |
3650 'The return type should use PassRefPtrWillBeRawPtr instead of RefPtr
WillBeRawPtr. [readability/pass_ptr] [5]') | |
3651 self.assert_pass_ptr_check( | |
3652 'OwnPtrWillBeRawPtr<Type1> myFunction(int)\n' | |
3653 '{\n' | |
3654 '}', | |
3655 'The return type should use PassOwnPtrWillBeRawPtr instead of OwnPtr
WillBeRawPtr. [readability/pass_ptr] [5]') | |
3656 | 3636 |
3657 def test_ref_ptr_parameter_value(self): | 3637 def test_ref_ptr_parameter_value(self): |
3658 self.assert_pass_ptr_check( | 3638 self.assert_pass_ptr_check( |
3659 'int myFunction(PassRefPtr<Type1>)\n' | 3639 'int myFunction(PassRefPtr<Type1>)\n' |
3660 '{\n' | 3640 '{\n' |
3661 '}', | 3641 '}', |
3662 '') | 3642 '') |
3663 self.assert_pass_ptr_check( | 3643 self.assert_pass_ptr_check( |
3664 'int myFunction(RefPtr<Type1>)\n' | |
3665 '{\n' | |
3666 '}', | |
3667 'The parameter type should use PassRefPtr instead of RefPtr. [reada
bility/pass_ptr] [5]') | |
3668 self.assert_pass_ptr_check( | |
3669 'int myFunction(RefPtr<Type1>&)\n' | 3644 'int myFunction(RefPtr<Type1>&)\n' |
3670 '{\n' | 3645 '{\n' |
3671 '}', | 3646 '}', |
3672 '') | 3647 '') |
3673 self.assert_pass_ptr_check( | 3648 self.assert_pass_ptr_check( |
3674 'int myFunction(RefPtr<Type1>*)\n' | 3649 'int myFunction(RefPtr<Type1>*)\n' |
3675 '{\n' | 3650 '{\n' |
3676 '}', | 3651 '}', |
3677 '') | 3652 '') |
3678 self.assert_pass_ptr_check( | 3653 self.assert_pass_ptr_check( |
(...skipping 17 matching lines...) Expand all Loading... |
3696 '}', | 3671 '}', |
3697 '') | 3672 '') |
3698 | 3673 |
3699 def test_own_ptr_parameter_value(self): | 3674 def test_own_ptr_parameter_value(self): |
3700 self.assert_pass_ptr_check( | 3675 self.assert_pass_ptr_check( |
3701 'int myFunction(PassOwnPtr<Type1>)\n' | 3676 'int myFunction(PassOwnPtr<Type1>)\n' |
3702 '{\n' | 3677 '{\n' |
3703 '}', | 3678 '}', |
3704 '') | 3679 '') |
3705 self.assert_pass_ptr_check( | 3680 self.assert_pass_ptr_check( |
3706 'int myFunction(OwnPtr<Type1>)\n' | |
3707 '{\n' | |
3708 '}', | |
3709 'The parameter type should use PassOwnPtr instead of OwnPtr. [reada
bility/pass_ptr] [5]') | |
3710 self.assert_pass_ptr_check( | |
3711 'int myFunction(OwnPtr<Type1>& simple)\n' | 3681 'int myFunction(OwnPtr<Type1>& simple)\n' |
3712 '{\n' | 3682 '{\n' |
3713 '}', | 3683 '}', |
3714 '') | 3684 '') |
3715 | 3685 |
3716 def test_ref_ptr_member_variable(self): | 3686 def test_ref_ptr_member_variable(self): |
3717 self.assert_pass_ptr_check( | 3687 self.assert_pass_ptr_check( |
3718 'class Foo {' | 3688 'class Foo {' |
3719 ' RefPtr<Type1> m_other;\n' | 3689 ' RefPtr<Type1> m_other;\n' |
3720 '};\n', | 3690 '};\n', |
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5290 def test_ne(self): | 5260 def test_ne(self): |
5291 """Test __ne__ inequality function.""" | 5261 """Test __ne__ inequality function.""" |
5292 checker1 = self._checker() | 5262 checker1 = self._checker() |
5293 checker2 = self._checker() | 5263 checker2 = self._checker() |
5294 | 5264 |
5295 # != calls __ne__. | 5265 # != calls __ne__. |
5296 # By default, __ne__ always returns true on different objects. | 5266 # By default, __ne__ always returns true on different objects. |
5297 # Thus, just check the distinguishing case to verify that the | 5267 # Thus, just check the distinguishing case to verify that the |
5298 # code defines __ne__. | 5268 # code defines __ne__. |
5299 self.assertFalse(checker1 != checker2) | 5269 self.assertFalse(checker1 != checker2) |
OLD | NEW |