| OLD | NEW |
| 1 // Copyright 2007, Google Inc. | 1 // Copyright 2007, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 return NULL; | 527 return NULL; |
| 528 } | 528 } |
| 529 }; | 529 }; |
| 530 | 530 |
| 531 // Implements the Return() action. | 531 // Implements the Return() action. |
| 532 class ReturnVoidAction { | 532 class ReturnVoidAction { |
| 533 public: | 533 public: |
| 534 // Allows Return() to be used in any void-returning function. | 534 // Allows Return() to be used in any void-returning function. |
| 535 template <typename Result, typename ArgumentTuple> | 535 template <typename Result, typename ArgumentTuple> |
| 536 static void Perform(const ArgumentTuple&) { | 536 static void Perform(const ArgumentTuple&) { |
| 537 CompileAssertTypesEqual<void, Result>(); | 537 (void)CompileAssertTypesEqual<void, Result>(); |
| 538 } | 538 } |
| 539 }; | 539 }; |
| 540 | 540 |
| 541 // Implements the polymorphic ReturnRef(x) action, which can be used | 541 // Implements the polymorphic ReturnRef(x) action, which can be used |
| 542 // in any function that returns a reference to the type of x, | 542 // in any function that returns a reference to the type of x, |
| 543 // regardless of the argument types. | 543 // regardless of the argument types. |
| 544 template <typename T> | 544 template <typename T> |
| 545 class ReturnRefAction { | 545 class ReturnRefAction { |
| 546 public: | 546 public: |
| 547 // Constructs a ReturnRefAction object from the reference to be returned. | 547 // Constructs a ReturnRefAction object from the reference to be returned. |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 // | 1019 // |
| 1020 // ByRef<const Base>(derived) | 1020 // ByRef<const Base>(derived) |
| 1021 template <typename T> | 1021 template <typename T> |
| 1022 inline internal::ReferenceWrapper<T> ByRef(T& l_value) { // NOLINT | 1022 inline internal::ReferenceWrapper<T> ByRef(T& l_value) { // NOLINT |
| 1023 return internal::ReferenceWrapper<T>(l_value); | 1023 return internal::ReferenceWrapper<T>(l_value); |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 } // namespace testing | 1026 } // namespace testing |
| 1027 | 1027 |
| 1028 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ | 1028 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_ |
| OLD | NEW |