Merge lp:~compiz-team/compiz/compiz.fix_1042041 into lp:compiz/0.9.8

Proposed by Sam Spilsbury
Status: Merged
Approved by: Martin Mrazik
Approved revision: 3397
Merged at revision: 3390
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1042041
Merge into: lp:compiz/0.9.8
Prerequisite: lp:~compiz-team/compiz/compiz.fix_1041535.1
Diff against target: 110 lines (+54/-9)
2 files modified
compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c (+1/-1)
compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp (+53/-8)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1042041
Reviewer Review Type Date Requested Status
jenkins (community) continuous-integration Approve
Daniel van Vugt Approve
Review via email: mp+125992@code.launchpad.net

This proposal supersedes a proposal from 2012-09-24.

Commit message

Actually change string settings to the new value, not the current one
(LP: #1042041)

Description of the change

Actually change string settings to the new value, not the current one. Tests updated (with matcher to actually check what value is being set, not that a value is being set):
CCSGSettingsIntegratedSettingTestMismatchedValues/CCSGSettingsIntegratedSettingTest.MatchedTypesReturnValueMismatchedTypesResetOrWrite/6 (0 ms)[ OK ]
CCSGSettingsIntegratedSettingTestMismatchedValues/CCSGSettingsIntegratedSettingTest.MatchedTypesReturnValueMismatchedTypesResetOrWrite/15 (0 ms)[ OK ]

To post a comment you must log in.
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Blocked, waiting for fixes to the prerequisite branch.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks fine (though I think the very long lines limit readability).

Tests pass.

Valgrind is happy too.

review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-compiz-core/288/console reported an error when processing this lp:~compiz-team/compiz/compiz.fix_1042041 branch.
Not merging it.

Revision history for this message
jenkins (martin-mrazik+qa) wrote :
review: Approve (continuous-integration)
Revision history for this message
Martin Mrazik (mrazik) wrote :

I'm not sure why the autolanding failed but it might be related to low disk space. I'm re-approving to see if it happens again.

Revision history for this message
Unity Merger (unity-merger) wrote :

The prerequisite lp:~compiz-team/compiz/compiz.fix_1041535.1 has not yet been merged into lp:compiz.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c'
--- compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c 2012-09-25 08:43:23 +0000
+++ compizconfig/integration/gnome/gsettings/src/ccs_gnome_integration_gsettings_integrated_setting.c 2012-09-25 08:43:23 +0000
@@ -192,7 +192,7 @@
192 if (currentValue)192 if (currentValue)
193 {193 {
194 if (strcmp (currentValue, newValue) != 0)194 if (strcmp (currentValue, newValue) != 0)
195 writeStringToVariant (currentValue, &newVariant);195 writeStringToVariant (newValue, &newVariant);
196 }196 }
197 }197 }
198 }198 }
199199
=== modified file 'compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp'
--- compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp 2012-09-25 08:43:23 +0000
+++ compizconfig/integration/gnome/gsettings/tests/compizconfig_test_ccs_gnome_gsettings_integrated_setting.cpp 2012-09-25 08:43:23 +0000
@@ -69,6 +69,7 @@
69 GVariant * s ();69 GVariant * s ();
70 GVariant * b ();70 GVariant * b ();
71 GVariant * as ();71 GVariant * as ();
72 GVariant * fromValue (CCSSettingValue *v, CCSSettingType type);
72 }73 }
7374
74 namespace value_generators75 namespace value_generators
@@ -124,6 +125,11 @@
124 }125 }
125}126}
126127
128MATCHER_P (VariantEqual, lhs, "Variants Equal")
129{
130 return g_variant_equal (lhs, arg);
131}
132
127namespace133namespace
128{134{
129 std::map <CCSSettingType, SpecialOptionType> &135 std::map <CCSSettingType, SpecialOptionType> &
@@ -169,6 +175,41 @@
169};175};
170176
171GVariant *177GVariant *
178ccvg::fromValue (CCSSettingValue *v,
179 CCSSettingType type)
180{
181 switch (type)
182 {
183 case TypeInt:
184 return g_variant_new ("i", v->value.asInt);
185 break;
186 case TypeBool:
187 return g_variant_new ("b", v->value.asBool);
188 break;
189 case TypeString:
190 return g_variant_new ("s", v->value.asString);
191 break;
192 case TypeKey:
193 {
194 GVariantBuilder builder;
195 g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
196
197 /* Represented internally as strings */
198 std::string kb (v->value.asString);
199 if (kb == "Disabled")
200 kb[0] = 'd';
201
202 g_variant_builder_add (&builder, "s", kb.c_str ());
203 return g_variant_builder_end (&builder);
204 }
205 default:
206 break;
207 }
208
209 return NULL;
210}
211
212GVariant *
172ccvg::as ()213ccvg::as ()
173{214{
174 GVariantBuilder builder;215 GVariantBuilder builder;
@@ -368,19 +409,23 @@
368 mWrapper.get (),409 mWrapper.get (),
369 &ccsDefaultObjectAllocator);410 &ccsDefaultObjectAllocator);
370411
371 CCSSettingValue *value = (*integratedSettingInfo.valueGenerator) ();412 boost::shared_ptr <CCSSettingValue> value ((*integratedSettingInfo.valueGenerator) (),
372 GVariant *variant = (*integratedSettingInfo.variantGenerator) ();413 boost::bind (ccsFreeSettingValueWithType,
373 EXPECT_CALL (*mWrapperMock, getValue (Eq (keyName))).WillOnce (Return (variant));414 _1,
415 integratedSettingInfo.settingType));
416 boost::shared_ptr <GVariant> variant = AutoDestroy (g_variant_ref ((*integratedSettingInfo.variantGenerator) ()),
417 g_variant_unref);
418 boost::shared_ptr <GVariant> newVariant = AutoDestroy (ccvg::fromValue (value.get (),
419 integratedSettingInfo.settingType),
420 g_variant_unref);
421 EXPECT_CALL (*mWrapperMock, getValue (Eq (keyName))).WillOnce (Return (variant.get ()));
374422
375 if (createSettingType == integratedSettingInfo.settingType)423 if (createSettingType == integratedSettingInfo.settingType)
376 EXPECT_CALL (*mWrapperMock, setValue (Eq (keyName), _)); // can't verify this right yet424 EXPECT_CALL (*mWrapperMock, setValue (Eq (keyName), VariantEqual (newVariant.get ())));
377 else425 else
378 EXPECT_CALL (*mWrapperMock, resetKey (Eq (keyName)));426 EXPECT_CALL (*mWrapperMock, resetKey (Eq (keyName)));
379427
380 ccsIntegratedSettingWriteValue (gsettingsIntegrated, value, createSettingType);428 ccsIntegratedSettingWriteValue (gsettingsIntegrated, value.get (), createSettingType);
381
382 if (value)
383 ccsFreeSettingValueWithType (value, integratedSettingInfo.settingType);
384}429}
385430
386INSTANTIATE_TEST_CASE_P (CCSGSettingsIntegratedSettingTestMismatchedValues, CCSGSettingsIntegratedSettingTest,431INSTANTIATE_TEST_CASE_P (CCSGSettingsIntegratedSettingTestMismatchedValues, CCSGSettingsIntegratedSettingTest,

Subscribers

People subscribed via source and target branches