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 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 self.assert_lint('a<Foo*> t <<= &b & &c; // Test', '') | 1778 self.assert_lint('a<Foo*> t <<= &b & &c; // Test', '') |
1779 self.assert_lint('a<Foo*> t <<= *b / &c; // Test', '') | 1779 self.assert_lint('a<Foo*> t <<= *b / &c; // Test', '') |
1780 self.assert_lint('if (a=b == 1)', 'Missing spaces around = [whitespace/
operators] [4]') | 1780 self.assert_lint('if (a=b == 1)', 'Missing spaces around = [whitespace/
operators] [4]') |
1781 self.assert_lint('a = 1<<20', 'Missing spaces around << [whitespace/ope
rators] [3]') | 1781 self.assert_lint('a = 1<<20', 'Missing spaces around << [whitespace/ope
rators] [3]') |
1782 self.assert_lint('a = 1>> 20', 'Missing spaces around >> [whitespace/op
erators] [3]') | 1782 self.assert_lint('a = 1>> 20', 'Missing spaces around >> [whitespace/op
erators] [3]') |
1783 self.assert_lint('a = 1 >>20', 'Missing spaces around >> [whitespace/op
erators] [3]') | 1783 self.assert_lint('a = 1 >>20', 'Missing spaces around >> [whitespace/op
erators] [3]') |
1784 self.assert_lint('a = 1>>20', 'Missing spaces around >> [whitespace/ope
rators] [3]') | 1784 self.assert_lint('a = 1>>20', 'Missing spaces around >> [whitespace/ope
rators] [3]') |
1785 self.assert_lint('func(OwnPtr<Vector<Foo>>)', '') | 1785 self.assert_lint('func(OwnPtr<Vector<Foo>>)', '') |
1786 self.assert_lint('func(OwnPtr<Vector<Foo>> foo)', '') | 1786 self.assert_lint('func(OwnPtr<Vector<Foo>> foo)', '') |
1787 self.assert_lint('func(OwnPtr<HashMap<Foo, Member<Bar>>>)', '') | 1787 self.assert_lint('func(OwnPtr<HashMap<Foo, Member<Bar>>>)', '') |
| 1788 self.assert_lint('func(OwnPtr<Vector<Foo> >)', 'Use >> for ending templa
te instead of > >. [readability/templatebrackets] [3]') |
| 1789 self.assert_lint('func(OwnPtr<HashMap<Foo, Member<Bar>> >)', 'Use >> for
ending template instead of > >. [readability/templatebrackets] [3]') |
| 1790 self.assert_lint('func(OwnPtr<HashMap<Foo, Member<Bar> >>)', 'Use >> for
ending template instead of > >. [readability/templatebrackets] [3]') |
| 1791 self.assert_lint('func(OwnPtr<HashMap<Foo, Member<Bar> > >)', 'Use >> fo
r ending template instead of > >. [readability/templatebrackets] [3]') |
| 1792 self.assert_lint('Vector< ::Foo>)', 'Use <:: for template start instead
of < ::. [readability/templatebrackets] [3]') |
| 1793 self.assert_lint('Vector<Vector< ::Foo>>)', 'Use <:: for template start
instead of < ::. [readability/templatebrackets] [3]') |
1788 # FIXME: The following test should not show any error. | 1794 # FIXME: The following test should not show any error. |
1789 self.assert_lint('func(OwnPtr<HashMap<Foo, Member<Bar\n >>>)', | 1795 self.assert_lint('func(OwnPtr<HashMap<Foo, Member<Bar\n >>>)', |
1790 'Missing spaces around < [whitespace/operators] [3]') | 1796 'Missing spaces around < [whitespace/operators] [3]') |
1791 self.assert_lint('if (a = b == 1)', '') | 1797 self.assert_lint('if (a = b == 1)', '') |
1792 self.assert_lint('a = 1 << 20', '') | 1798 self.assert_lint('a = 1 << 20', '') |
1793 self.assert_multi_line_lint('#include <sys/io.h>\n', '') | 1799 self.assert_multi_line_lint('#include <sys/io.h>\n', '') |
1794 self.assert_multi_line_lint('#import <foo/bar.h>\n', '') | 1800 self.assert_multi_line_lint('#import <foo/bar.h>\n', '') |
1795 | 1801 |
1796 def test_operator_methods(self): | 1802 def test_operator_methods(self): |
1797 self.assert_lint('String operator+(const String&, const String&);', '') | 1803 self.assert_lint('String operator+(const String&, const String&);', '') |
(...skipping 3116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4914 self.assert_lint('const int UNDER_SCORE;', | 4920 self.assert_lint('const int UNDER_SCORE;', |
4915 'UNDER_SCORE' + name_underscore_error_message) | 4921 'UNDER_SCORE' + name_underscore_error_message) |
4916 self.assert_lint('static inline const char const& const under_score;', | 4922 self.assert_lint('static inline const char const& const under_score;', |
4917 'under_score' + name_underscore_error_message) | 4923 'under_score' + name_underscore_error_message) |
4918 self.assert_lint('WebCore::RenderObject* under_score;', | 4924 self.assert_lint('WebCore::RenderObject* under_score;', |
4919 'under_score' + name_underscore_error_message) | 4925 'under_score' + name_underscore_error_message) |
4920 self.assert_lint('int func_name();', | 4926 self.assert_lint('int func_name();', |
4921 'func_name' + name_underscore_error_message) | 4927 'func_name' + name_underscore_error_message) |
4922 self.assert_lint('RefPtr<RenderObject*> under_score;', | 4928 self.assert_lint('RefPtr<RenderObject*> under_score;', |
4923 'under_score' + name_underscore_error_message) | 4929 'under_score' + name_underscore_error_message) |
4924 self.assert_lint('WTF::Vector<WTF::RefPtr<const RenderObject* const> > u
nder_score;', | 4930 self.assert_lint('WTF::Vector<WTF::RefPtr<const RenderObject* const>> un
der_score;', |
4925 'under_score' + name_underscore_error_message) | 4931 'under_score' + name_underscore_error_message) |
4926 self.assert_lint('int under_score[];', | 4932 self.assert_lint('int under_score[];', |
4927 'under_score' + name_underscore_error_message) | 4933 'under_score' + name_underscore_error_message) |
4928 self.assert_lint('struct dirent* under_score;', | 4934 self.assert_lint('struct dirent* under_score;', |
4929 'under_score' + name_underscore_error_message) | 4935 'under_score' + name_underscore_error_message) |
4930 self.assert_lint('long under_score;', | 4936 self.assert_lint('long under_score;', |
4931 'under_score' + name_underscore_error_message) | 4937 'under_score' + name_underscore_error_message) |
4932 self.assert_lint('long long under_score;', | 4938 self.assert_lint('long long under_score;', |
4933 'under_score' + name_underscore_error_message) | 4939 'under_score' + name_underscore_error_message) |
4934 self.assert_lint('long double under_score;', | 4940 self.assert_lint('long double under_score;', |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5201 def test_ne(self): | 5207 def test_ne(self): |
5202 """Test __ne__ inequality function.""" | 5208 """Test __ne__ inequality function.""" |
5203 checker1 = self._checker() | 5209 checker1 = self._checker() |
5204 checker2 = self._checker() | 5210 checker2 = self._checker() |
5205 | 5211 |
5206 # != calls __ne__. | 5212 # != calls __ne__. |
5207 # By default, __ne__ always returns true on different objects. | 5213 # By default, __ne__ always returns true on different objects. |
5208 # Thus, just check the distinguishing case to verify that the | 5214 # Thus, just check the distinguishing case to verify that the |
5209 # code defines __ne__. | 5215 # code defines __ne__. |
5210 self.assertFalse(checker1 != checker2) | 5216 self.assertFalse(checker1 != checker2) |
OLD | NEW |