| Index: PRESUBMIT_test.py
|
| diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
|
| index 6a29aca96ed4af7dbb7c506f920e8d6b0b000b7a..8c4b3ffe7baf1c163683c68eae5b3eaef7442092 100755
|
| --- a/PRESUBMIT_test.py
|
| +++ b/PRESUBMIT_test.py
|
| @@ -295,7 +295,7 @@ class IncludeOrderTest(unittest.TestCase):
|
| self.assertEqual(0, len(warnings))
|
|
|
|
|
| -class VersionControlerConflictsTest(unittest.TestCase):
|
| +class VersionControlConflictsTest(unittest.TestCase):
|
| def testTypicalConflict(self):
|
| lines = ['<<<<<<< HEAD',
|
| ' base::ScopedTempDir temp_dir_;',
|
| @@ -356,5 +356,25 @@ class BadExtensionsTest(unittest.TestCase):
|
| self.assertEqual(0, len(results))
|
|
|
|
|
| +class InvalidOSMacroNamesTest(unittest.TestCase):
|
| + def testInvalidOSMacroNames(self):
|
| + lines = ['#if defined(OS_WINDOWS)',
|
| + ' #elif defined(OS_WINDOW)',
|
| + ' # if defined(OS_MACOSX) || defined(OS_CHROME)',
|
| + '# else // defined(OS_MAC)',
|
| + '#endif // defined(OS_MACOS)']
|
| + errors = PRESUBMIT._CheckForInvalidOSMacrosInFile(
|
| + MockInputApi(), MockFile('some/path/foo_platform.cc', lines))
|
| + self.assertEqual(len(lines), len(errors))
|
| + self.assertTrue(':1 OS_WINDOWS' in errors[0])
|
| + self.assertTrue('(did you mean OS_WIN?)' in errors[0])
|
| +
|
| + def testValidOSMacroNames(self):
|
| + lines = ['#if defined(%s)' % m for m in PRESUBMIT._VALID_OS_MACROS]
|
| + errors = PRESUBMIT._CheckForInvalidOSMacrosInFile(
|
| + MockInputApi(), MockFile('some/path/foo_platform.cc', lines))
|
| + self.assertEqual(0, len(errors))
|
| +
|
| +
|
| if __name__ == '__main__':
|
| unittest.main()
|
|
|