aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-actions.h
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/include/gmock/gmock-actions.h')
-rw-r--r--googlemock/include/gmock/gmock-actions.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h
index b82313d5..e3b3f094 100644
--- a/googlemock/include/gmock/gmock-actions.h
+++ b/googlemock/include/gmock/gmock-actions.h
@@ -137,7 +137,7 @@ template <typename T>
class BuiltInDefaultValue<T*> {
public:
static bool Exists() { return true; }
- static T* Get() { return NULL; }
+ static T* Get() { return nullptr; }
};
// The following specializations define the default values for
@@ -220,11 +220,11 @@ class DefaultValue {
// Unsets the default value for type T.
static void Clear() {
delete producer_;
- producer_ = NULL;
+ producer_ = nullptr;
}
// Returns true iff the user has set the default value for type T.
- static bool IsSet() { return producer_ != NULL; }
+ static bool IsSet() { return producer_ != nullptr; }
// Returns true if T has a default return value set by the user or there
// exists a built-in default value.
@@ -236,8 +236,8 @@ class DefaultValue {
// otherwise returns the built-in default value. Requires that Exists()
// is true, which ensures that the return value is well-defined.
static T Get() {
- return producer_ == NULL ?
- internal::BuiltInDefaultValue<T>::Get() : producer_->Produce();
+ return producer_ == nullptr ? internal::BuiltInDefaultValue<T>::Get()
+ : producer_->Produce();
}
private:
@@ -282,12 +282,10 @@ class DefaultValue<T&> {
}
// Unsets the default value for type T&.
- static void Clear() {
- address_ = NULL;
- }
+ static void Clear() { address_ = nullptr; }
// Returns true iff the user has set the default value for type T&.
- static bool IsSet() { return address_ != NULL; }
+ static bool IsSet() { return address_ != nullptr; }
// Returns true if T has a default return value set by the user or there
// exists a built-in default value.
@@ -299,8 +297,8 @@ class DefaultValue<T&> {
// otherwise returns the built-in default value if there is one;
// otherwise aborts the process.
static T& Get() {
- return address_ == NULL ?
- internal::BuiltInDefaultValue<T&>::Get() : *address_;
+ return address_ == nullptr ? internal::BuiltInDefaultValue<T&>::Get()
+ : *address_;
}
private:
@@ -318,11 +316,11 @@ class DefaultValue<void> {
// Points to the user-set default value for type T.
template <typename T>
-typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = NULL;
+typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = nullptr;
// Points to the user-set default value for type T&.
template <typename T>
-T* DefaultValue<T&>::address_ = NULL;
+T* DefaultValue<T&>::address_ = nullptr;
// Implement this interface to define an action for function type F.
template <typename F>
@@ -1108,8 +1106,9 @@ Action<To>::Action(const Action<From>& from)
#if GTEST_LANG_CXX11
fun_(from.fun_),
#endif
- impl_(from.impl_ == NULL ? NULL
- : new internal::ActionAdaptor<To, From>(from)) {
+ impl_(from.impl_ == nullptr
+ ? nullptr
+ : new internal::ActionAdaptor<To, From>(from)) {
}
// Creates an action that returns 'value'. 'value' is passed by value