Merge lp:~michihenning/unity-scopes-api/check-utility-headers into lp:unity-scopes-api

Proposed by Michi Henning
Status: Superseded
Proposed branch: lp:~michihenning/unity-scopes-api/check-utility-headers
Merge into: lp:unity-scopes-api
Diff against target: 66 lines (+13/-3)
4 files modified
src/scopes/internal/JsonCppNode.cpp (+5/-0)
src/scopes/internal/JsonSettingsSchema.cpp (+5/-1)
test/gtest/scopes/internal/JsonSettingsSchema/JsonSettingsSchema_test.cpp (+2/-2)
test/headers/CMakeLists.txt (+1/-0)
To merge this branch: bzr merge lp:~michihenning/unity-scopes-api/check-utility-headers
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+246666@code.launchpad.net

This proposal has been superseded by a proposal from 2015-01-16.

Commit message

Added utility subdir to header tests.

Description of the change

Added utility subdir to header tests.

To post a comment you must log in.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/scopes/internal/JsonCppNode.cpp'
2--- src/scopes/internal/JsonCppNode.cpp 2014-08-18 08:12:22 +0000
3+++ src/scopes/internal/JsonCppNode.cpp 2015-01-16 01:15:42 +0000
4@@ -252,6 +252,11 @@
5
6 bool JsonCppNode::has_node(std::string const& node_name) const
7 {
8+ if (!root_)
9+ {
10+ throw unity::LogicException("Current node is empty");
11+ }
12+
13 return root_.isMember(node_name);
14 }
15
16
17=== modified file 'src/scopes/internal/JsonSettingsSchema.cpp'
18--- src/scopes/internal/JsonSettingsSchema.cpp 2014-11-20 21:33:33 +0000
19+++ src/scopes/internal/JsonSettingsSchema.cpp 2015-01-16 01:15:42 +0000
20@@ -181,7 +181,11 @@
21 void Setting::set_default_value(Json::Value const& v, Type expected_type)
22 {
23 auto v_param = v[parameters_key];
24- if (!v_param.isObject())
25+ if (v_param.isNull())
26+ {
27+ return;
28+ }
29+ else if (!v_param.isObject())
30 {
31 throw ResourceException("JsonSettingsSchema(): expected value of type object for \"parameters\", id = \"" + id_ + "\"");
32 }
33
34=== modified file 'test/gtest/scopes/internal/JsonSettingsSchema/JsonSettingsSchema_test.cpp'
35--- test/gtest/scopes/internal/JsonSettingsSchema/JsonSettingsSchema_test.cpp 2014-11-20 21:33:33 +0000
36+++ test/gtest/scopes/internal/JsonSettingsSchema/JsonSettingsSchema_test.cpp 2015-01-16 01:15:42 +0000
37@@ -397,7 +397,7 @@
38 {
39 "id": "x",
40 "type": "number",
41- "displayName": "X",
42+ "displayName": "X",
43 "parameters": {
44 "defaultValue": "banana"
45 }
46@@ -457,7 +457,7 @@
47 }
48 catch (ResourceException const& e)
49 {
50- EXPECT_STREQ("unity::ResourceException: JsonSettingsSchema(): missing \"parameters\" definition, id = \"x\"",
51+ EXPECT_STREQ("unity::ResourceException: JsonSettingsSchema(): missing \"displayName\" definition, id = \"x\"",
52 e.what());
53 }
54
55
56=== modified file 'test/headers/CMakeLists.txt'
57--- test/headers/CMakeLists.txt 2014-07-07 05:07:51 +0000
58+++ test/headers/CMakeLists.txt 2015-01-16 01:15:42 +0000
59@@ -7,6 +7,7 @@
60 set(subdirs
61 unity/scopes
62 unity/scopes/testing
63+ unity/scopes/utility
64 )
65 foreach(dir ${OTHER_INCLUDE_DIRS})
66 set(other_inc_dirs "${other_inc_dirs} -I${dir}")

Subscribers

People subscribed via source and target branches

to all changes: