Merge lp:~marcustomlinson/unity-scopes-api/fix-querymetadata-tests into lp:unity-scopes-api/devel

Proposed by Marcus Tomlinson on 2015-10-29
Status: Merged
Approved by: Marcus Tomlinson on 2015-10-29
Approved revision: 637
Merged at revision: 638
Proposed branch: lp:~marcustomlinson/unity-scopes-api/fix-querymetadata-tests
Merge into: lp:unity-scopes-api/devel
Diff against target: 86 lines (+16/-7)
1 file modified
test/gtest/scopes/QueryMetadata/QueryMetadata_test.cpp (+16/-7)
To merge this branch: bzr merge lp:~marcustomlinson/unity-scopes-api/fix-querymetadata-tests
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration 2015-10-29 Approve on 2015-10-29
Marcus Tomlinson (community) Approve on 2015-10-29
Paweł Stołowski 2015-10-29 Pending
Review via email: mp+276086@code.launchpad.net

This proposal supersedes a proposal from 2015-10-19.

Commit message

Fixed QueryMetadata tests that were checking the incorrect metadata for copied internet_connectivity statuses

To post a comment you must log in.
Paweł Stołowski (stolowski) wrote : Posted in a previous version of this proposal

Yeah, thanks!

review: Approve
637. By Marcus Tomlinson on 2015-10-29

Fixed QueryMetadata tests that were checking the incorrect metadata for copied internet_connectivity statuses

Marcus Tomlinson (marcustomlinson) wrote :

Re-approving this as I was targeting trunk instead of devel before. Diff is exactly the same.

review: Approve
review: Approve (continuous-integration)
Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

Hmmm... The diff looks very wrong. It includes all the abi-compliance changes. Not sure why this is happening, but it might be good to double-check?

Michi Henning (michihenning) wrote : Posted in a previous version of this proposal

Ah, OK, sorry for the noise. I just saw the replacement version of this :-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test/gtest/scopes/QueryMetadata/QueryMetadata_test.cpp'
2--- test/gtest/scopes/QueryMetadata/QueryMetadata_test.cpp 2014-09-03 13:00:31 +0000
3+++ test/gtest/scopes/QueryMetadata/QueryMetadata_test.cpp 2015-10-29 06:24:31 +0000
4@@ -132,9 +132,11 @@
5 auto meta2 = meta;
6
7 meta.set_cardinality(0);
8+ meta.set_internet_connectivity(QueryMetadata::Connected);
9 EXPECT_EQ(0, meta.cardinality());
10 EXPECT_EQ(100, meta2.cardinality());
11- EXPECT_EQ(QueryMetadata::Unknown, meta.internet_connectivity());
12+ EXPECT_EQ(QueryMetadata::Connected, meta.internet_connectivity());
13+ EXPECT_EQ(QueryMetadata::Unknown, meta2.internet_connectivity());
14 EXPECT_DOUBLE_EQ(1.0, meta.location().latitude());
15 EXPECT_DOUBLE_EQ(2.0, meta.location().longitude());
16 EXPECT_DOUBLE_EQ(1.0, meta2.location().latitude());
17@@ -143,13 +145,15 @@
18 {
19 SearchMetadata meta(100, "pl", "phone");
20 meta.set_location(Location(1.0, 2.0));
21+ meta.set_internet_connectivity(QueryMetadata::Disconnected);
22 SearchMetadata meta2(meta);
23
24 meta.set_cardinality(0);
25 meta.set_location(Location(3.0, 4.0));
26 EXPECT_EQ(0, meta.cardinality());
27 EXPECT_EQ(100, meta2.cardinality());
28- EXPECT_EQ(QueryMetadata::Unknown, meta.internet_connectivity());
29+ EXPECT_EQ(QueryMetadata::Disconnected, meta.internet_connectivity());
30+ EXPECT_EQ(QueryMetadata::Disconnected, meta2.internet_connectivity());
31 EXPECT_DOUBLE_EQ(1.0, meta2.location().latitude());
32 EXPECT_DOUBLE_EQ(2.0, meta2.location().longitude());
33 EXPECT_DOUBLE_EQ(3.0, meta.location().latitude());
34@@ -157,23 +161,26 @@
35 }
36 {
37 SearchMetadata meta(100, "pl", "phone");
38+ meta.set_internet_connectivity(QueryMetadata::Connected);
39 auto meta2 = meta;
40
41 meta.set_cardinality(0);
42- meta.set_internet_connectivity(QueryMetadata::Connected);
43 EXPECT_EQ(0, meta.cardinality());
44 EXPECT_EQ(100, meta2.cardinality());
45 EXPECT_EQ(QueryMetadata::Connected, meta.internet_connectivity());
46+ EXPECT_EQ(QueryMetadata::Connected, meta2.internet_connectivity());
47 }
48 {
49 SearchMetadata meta(100, "pl", "phone");
50+ meta.set_internet_connectivity(QueryMetadata::Disconnected);
51 SearchMetadata meta2(meta);
52
53 meta.set_cardinality(0);
54- meta.set_internet_connectivity(QueryMetadata::Disconnected);
55+ meta.set_internet_connectivity(QueryMetadata::Connected);
56 EXPECT_EQ(0, meta.cardinality());
57 EXPECT_EQ(100, meta2.cardinality());
58- EXPECT_EQ(QueryMetadata::Disconnected, meta.internet_connectivity());
59+ EXPECT_EQ(QueryMetadata::Connected, meta.internet_connectivity());
60+ EXPECT_EQ(QueryMetadata::Disconnected, meta2.internet_connectivity());
61 }
62 }
63
64@@ -263,18 +270,20 @@
65
66 EXPECT_TRUE(meta2.scope_data().is_null());
67 EXPECT_EQ("foo", meta.scope_data().get_string());
68+ EXPECT_EQ(QueryMetadata::Unknown, meta2.internet_connectivity());
69 EXPECT_EQ(QueryMetadata::Unknown, meta.internet_connectivity());
70 }
71 {
72 ActionMetadata meta("pl", "phone");
73+ meta.set_internet_connectivity(QueryMetadata::Connected);
74 ActionMetadata meta2(meta);
75
76 Variant var(10);
77 meta.set_scope_data(var);
78- meta.set_internet_connectivity(QueryMetadata::Disconnected);
79
80 EXPECT_TRUE(meta2.scope_data().is_null());
81 EXPECT_EQ(10, meta.scope_data().get_int());
82- EXPECT_EQ(QueryMetadata::Disconnected, meta.internet_connectivity());
83+ EXPECT_EQ(QueryMetadata::Connected, meta2.internet_connectivity());
84+ EXPECT_EQ(QueryMetadata::Connected, meta.internet_connectivity());
85 }
86 }

Subscribers

People subscribed via source and target branches

to all changes: