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

Side by Side Diff: Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

Issue 15030003: Updated style checker for wtf/file.h includes. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated webkitpy tests Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Tools/Scripts/webkitpy/style/checkers/cpp.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2813 matching lines...) Expand 10 before | Expand all | Expand 10 after
2824 '\n' 2824 '\n'
2825 '#include "a.h"\n', 2825 '#include "a.h"\n',
2826 'Alphabetical sorting problem. [build/ include_order] [4]') 2826 'Alphabetical sorting problem. [build/ include_order] [4]')
2827 2827
2828 def test_check_wtf_includes(self): 2828 def test_check_wtf_includes(self):
2829 self.assert_language_rules_check('foo.cpp', 2829 self.assert_language_rules_check('foo.cpp',
2830 '#include "config.h"\n' 2830 '#include "config.h"\n'
2831 '#include "foo.h"\n' 2831 '#include "foo.h"\n'
2832 '\n' 2832 '\n'
2833 '#include <wtf/Assertions.h>\n', 2833 '#include <wtf/Assertions.h>\n',
2834 '') 2834 'wtf includes should be "wtf/file.h" in stead of <wtf/file.h>.'
2835 ' [build/include] [4]')
2835 self.assert_language_rules_check('foo.cpp', 2836 self.assert_language_rules_check('foo.cpp',
2836 '#include "config.h"\n' 2837 '#include "config.h"\n'
2837 '#include "foo.h"\n' 2838 '#include "foo.h"\n'
2838 '\n' 2839 '\n'
2839 '#include "wtf/Assertions.h"\n', 2840 '#include "wtf/Assertions.h"\n',
2840 'wtf includes should be <wtf/file.h> in stead of "wtf/file.h".' 2841 '')
2841 ' [build/include] [4]')
2842 2842
2843 def test_check_cc_includes(self): 2843 def test_check_cc_includes(self):
2844 self.assert_language_rules_check('bar/chromium/foo.cpp', 2844 self.assert_language_rules_check('bar/chromium/foo.cpp',
2845 '#include "config.h"\n' 2845 '#include "config.h"\n'
2846 '#include "foo.h"\n' 2846 '#include "foo.h"\n'
2847 '\n' 2847 '\n'
2848 '#include "cc/CCProxy.h"\n', 2848 '#include "cc/CCProxy.h"\n',
2849 'cc includes should be "CCFoo.h" instea d of "cc/CCFoo.h".' 2849 'cc includes should be "CCFoo.h" instea d of "cc/CCFoo.h".'
2850 ' [build/include] [4]') 2850 ' [build/include] [4]')
2851 2851
(...skipping 2112 matching lines...) Expand 10 before | Expand all | Expand 10 after
4964 def test_ne(self): 4964 def test_ne(self):
4965 """Test __ne__ inequality function.""" 4965 """Test __ne__ inequality function."""
4966 checker1 = self._checker() 4966 checker1 = self._checker()
4967 checker2 = self._checker() 4967 checker2 = self._checker()
4968 4968
4969 # != calls __ne__. 4969 # != calls __ne__.
4970 # By default, __ne__ always returns true on different objects. 4970 # By default, __ne__ always returns true on different objects.
4971 # Thus, just check the distinguishing case to verify that the 4971 # Thus, just check the distinguishing case to verify that the
4972 # code defines __ne__. 4972 # code defines __ne__.
4973 self.assertFalse(checker1 != checker2) 4973 self.assertFalse(checker1 != checker2)
OLDNEW
« no previous file with comments | « Tools/Scripts/webkitpy/style/checkers/cpp.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698