summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py')
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 2dde549..ee829aa 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -164,7 +164,7 @@ class CppStyleTestBase(unittest.TestCase):
class_state = cpp_style._ClassState()
file_state = cpp_style._FileState()
for i in xrange(lines.num_lines()):
- cpp_style.check_style(lines, i, file_extension, file_state, error_collector)
+ cpp_style.check_style(lines, i, file_extension, class_state, file_state, error_collector)
cpp_style.check_for_non_standard_constructs(lines, i, class_state,
error_collector)
class_state.check_finished(error_collector)
@@ -2594,6 +2594,19 @@ class NoNonVirtualDestructorsTest(CppStyleTestBase):
self.assert_multi_line_lint(
'class Foo { void foo(); };',
'More than one command on the same line [whitespace/newline] [4]')
+ self.assert_multi_line_lint(
+ 'class MyClass {\n'
+ ' int getIntValue() { ASSERT(m_ptr); return *m_ptr; }\n'
+ '};\n',
+ '')
+ self.assert_multi_line_lint(
+ 'class MyClass {\n'
+ ' int getIntValue()\n'
+ ' {\n'
+ ' ASSERT(m_ptr); return *m_ptr;\n'
+ ' }\n'
+ '};\n',
+ 'More than one command on the same line [whitespace/newline] [4]')
self.assert_multi_line_lint(
'''class Qualified::Goo : public Foo {
@@ -3472,6 +3485,15 @@ class WebKitStyleTest(CppStyleTestBase):
self.assert_lint(
'gchar* result = g_strjoin(",", "part1", NULL);',
'')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_callback(pixbuf, function, data, type, error, NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_buffer(pixbuf, function, data, type, error, NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_stream(pixbuf, function, data, type, error, NULL);',
+ '')
# 2. C++ and C bool values should be written as true and
# false. Objective-C BOOL values should be written as YES and NO.