diff options
author | Alex Kutsan <akutsan@luxoft.com> | 2017-01-27 16:28:34 +0200 |
---|---|---|
committer | Alex Kutsan <akutsan@luxoft.com> | 2017-01-27 16:28:34 +0200 |
commit | 6b408ccced65e5bc7ce0d911cc4884223eaeac56 (patch) | |
tree | c3495a73ec8a16f681433448023f43b0e973334a /src/components/rpc_base | |
parent | 6cc4475f1300dfd351d3b203d9881fa6fe6e4ee1 (diff) | |
parent | 55d7b3429d974e9e4d945920a93cdec02f2dcb06 (diff) | |
download | sdl_core-6b408ccced65e5bc7ce0d911cc4884223eaeac56.tar.gz |
Merge release to develop
Diffstat (limited to 'src/components/rpc_base')
4 files changed, 6 insertions, 7 deletions
diff --git a/src/components/rpc_base/include/rpc_base/rpc_base.h b/src/components/rpc_base/include/rpc_base/rpc_base.h index 951ce09e2a..6792f47732 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base.h @@ -58,7 +58,7 @@ enum PolicyTableType { PT_UPDATE, PT_SNAPSHOT }; -const std::string ommited_validation_info = "should be ommited in "; +const std::string omitted_validation_info = "should be omitted in "; const std::string required_validation_info = "is required in "; std::string PolicyTableTypeToString(const PolicyTableType pt_type); @@ -300,7 +300,7 @@ class Array : public std::vector<T>, public CompositeType { Json::Value ToJsonValue() const; void ToDbusWriter(dbus::MessageWriter* writer) const; - bool is_valid() const; + virtual bool is_valid() const; bool is_initialized() const; void ReportErrors(ValidationReport* report) const; virtual void SetPolicyTableType( diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h index dad741a6f6..6070f5d757 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base_inl.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base_inl.h @@ -177,7 +177,7 @@ Integer<T, minval, maxval>& Integer<T, minval, maxval>::operator=( const Integer& new_val) { this->value_ = new_val.value_; if (new_val.is_initialized()) { - this->value_state_ = range_.Includes(new_val.value_) ? kValid : kInvalid; + this->value_state_ = new_val.value_state_; } return *this; diff --git a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h index d45a21cdaf..05e9406317 100644 --- a/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h +++ b/src/components/rpc_base/include/rpc_base/rpc_base_json_inl.h @@ -140,8 +140,7 @@ Integer<T, minval, maxval>::Integer(const Json::Value* value) template <typename T, T minval, T maxval> Integer<T, minval, maxval>::Integer(const Integer& val) - : PrimitiveType(range_.Includes(val.value_) ? kValid : kInvalid) - , value_(val.value_) {} + : PrimitiveType(val.value_state_), value_(val.value_) {} template <typename T, T minval, T maxval> Integer<T, minval, maxval>::Integer(const Json::Value* value, IntType def_value) diff --git a/src/components/rpc_base/test/rpc_base_json_test.cc b/src/components/rpc_base/test/rpc_base_json_test.cc index 7b14d20b61..cad9dd3a65 100644 --- a/src/components/rpc_base/test/rpc_base_json_test.cc +++ b/src/components/rpc_base/test/rpc_base_json_test.cc @@ -281,8 +281,8 @@ TEST(ValidatedTypesJson, OptionalMapAbsentValueTest) { TEST(ValidatedTypesJson, ArrayJsonTest) { Value array_value; - array_value.append(Value("Hello")); - array_value.append(Value("World")); + array_value.append(Value(10)); + array_value.append(Value(20)); Array<Integer<int8_t, 0, 32>, 2, 4> int_array(&array_value); ASSERT_TRUE(int_array.is_initialized()); ASSERT_TRUE(int_array.is_valid()); |