OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2008, Google Inc. | 3 # Copyright 2008, Google Inc. |
4 # All rights reserved. | 4 # All rights reserved. |
5 # | 5 # |
6 # Redistribution and use in source and binary forms, with or without | 6 # Redistribution and use in source and binary forms, with or without |
7 # modification, are permitted provided that the following conditions are | 7 # modification, are permitted provided that the following conditions are |
8 # met: | 8 # met: |
9 # | 9 # |
10 # * Redistributions of source code must retain the above copyright | 10 # * Redistributions of source code must retain the above copyright |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 All actions but the last in DoAll(...) must return void. Perhaps you need | 196 All actions but the last in DoAll(...) must return void. Perhaps you need |
197 to re-arrange the order of actions in a DoAll(), if you are using one?""" | 197 to re-arrange the order of actions in a DoAll(), if you are using one?""" |
198 return _GenericDiagnoser('NRN', 'Need to Return Nothing', | 198 return _GenericDiagnoser('NRN', 'Need to Return Nothing', |
199 regex, diagnosis, msg) | 199 regex, diagnosis, msg) |
200 | 200 |
201 | 201 |
202 def _IncompleteByReferenceArgumentDiagnoser(msg): | 202 def _IncompleteByReferenceArgumentDiagnoser(msg): |
203 """Diagnoses the IBRA disease, given the error messages by gcc.""" | 203 """Diagnoses the IBRA disease, given the error messages by gcc.""" |
204 | 204 |
205 regex = (_FILE_LINE_RE + r'instantiated from here\n' | 205 regex = (_FILE_LINE_RE + r'instantiated from here\n' |
206 r'.*gmock-printers\.h.*error: invalid application of ' | 206 r'.*gtest-printers\.h.*error: invalid application of ' |
207 r'\'sizeof\' to incomplete type \'(?P<type>.*)\'') | 207 r'\'sizeof\' to incomplete type \'(?P<type>.*)\'') |
208 diagnosis = """ | 208 diagnosis = """ |
209 In order to mock this function, Google Mock needs to see the definition | 209 In order to mock this function, Google Mock needs to see the definition |
210 of type "%(type)s" - declaration alone is not enough. Either #include | 210 of type "%(type)s" - declaration alone is not enough. Either #include |
211 the header that defines it, or change the argument to be passed | 211 the header that defines it, or change the argument to be passed |
212 by pointer.""" | 212 by pointer.""" |
213 return _GenericDiagnoser('IBRA', 'Incomplete By-Reference Argument Type', | 213 return _GenericDiagnoser('IBRA', 'Incomplete By-Reference Argument Type', |
214 regex, diagnosis, msg) | 214 regex, diagnosis, msg) |
215 | 215 |
216 | 216 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 print '\n#%s:' % (i,) | 510 print '\n#%s:' % (i,) |
511 print d | 511 print d |
512 print """ | 512 print """ |
513 How did I do? If you think I'm wrong or unhelpful, please send your | 513 How did I do? If you think I'm wrong or unhelpful, please send your |
514 source code and gcc's error messages to googlemock@googlegroups.com. Then | 514 source code and gcc's error messages to googlemock@googlegroups.com. Then |
515 you can be helped and I can get smarter -- I promise I won't be upset!""" | 515 you can be helped and I can get smarter -- I promise I won't be upset!""" |
516 | 516 |
517 | 517 |
518 if __name__ == '__main__': | 518 if __name__ == '__main__': |
519 main() | 519 main() |
OLD | NEW |