| 325 | } |
| 326 | |
| 327 | void compare_single_function(t_function* newFunction, t_function* oldFunction) |
| 328 | { |
| 329 | t_type* newFunctionReturnType = newFunction->get_returntype(); |
| 330 | |
| 331 | if(newFunction->is_oneway() != oldFunction->is_oneway()) |
| 332 | { |
| 333 | thrift_audit_failure("Oneway attribute changed for function %s\n",oldFunction->get_name().c_str()); |
| 334 | } |
| 335 | if(!compare_type(newFunctionReturnType, oldFunction->get_returntype())) |
| 336 | { |
| 337 | thrift_audit_failure("Return type changed for function %s\n",oldFunction->get_name().c_str()); |
| 338 | } |
| 339 | |
| 340 | //Compare function arguments. |
| 341 | compare_single_struct(newFunction->get_arglist(), oldFunction->get_arglist()); |
| 342 | std::string exceptionName = oldFunction->get_name(); |
| 343 | exceptionName += "_exception"; |
| 344 | compare_single_struct(newFunction->get_xceptions(), oldFunction->get_xceptions(), exceptionName); |
| 345 | } |
| 346 | |
| 347 | void compare_functions(const std::vector<t_function*>& newFunctionList, const std::vector<t_function*>& oldFunctionList) |
| 348 | { |
no test coverage detected