summaryrefslogtreecommitdiff
path: root/indra/llxml/tests/llcontrol_test.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2013-07-17 11:30:09 -0400
committerNat Goodspeed <nat@lindenlab.com>2013-07-17 11:30:09 -0400
commitfd14c250b8aa7b2d512194b164646ff7f658bef3 (patch)
tree7e022b9a33182a35b4848a5237d9c3b1916e4b00 /indra/llxml/tests/llcontrol_test.cpp
parent2b3c1bd40d11b02cb097cb3dba7a661a4b528a91 (diff)
CHOP-962: Preserve unrecognized user settings variables.
Change LLControlVariable::mPersist from bool to tri-state enum. Its 'true' value used to mean "persist only if changed from default;" third state now means "persist regardless of value." Add forcePersist() method to set that. Replace isSaveValueDefault() method -- used only by logic to determine whether to save the variable -- with shouldSave() method to encapsulate ALL that logic rather than only part of it. shouldSave() recognizes PERSIST_ALWAYS state. When loading an unrecognized control variable from a user settings file, use forcePersist() to ensure that we later save that variable again. Tweak one of the unit tests to adjust for new semantics.
Diffstat (limited to 'indra/llxml/tests/llcontrol_test.cpp')
-rwxr-xr-xindra/llxml/tests/llcontrol_test.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/indra/llxml/tests/llcontrol_test.cpp b/indra/llxml/tests/llcontrol_test.cpp
index ede81956ec..c273773c9b 100755
--- a/indra/llxml/tests/llcontrol_test.cpp
+++ b/indra/llxml/tests/llcontrol_test.cpp
@@ -128,7 +128,11 @@ namespace tut
template<> template<>
void control_group_t::test<3>()
{
- int results = mCG->loadFromFile(mTestConfigFile.c_str());
+ // Pass default_values = true. This tells loadFromFile() we're loading
+ // a default settings file that declares variables, rather than a user
+ // settings file. When loadFromFile() encounters an unrecognized user
+ // settings variable, it forcibly preserves it (CHOP-962).
+ int results = mCG->loadFromFile(mTestConfigFile.c_str(), true);
LLControlVariable* control = mCG->getControl("TestSetting");
LLSD new_value = 13;
control->setValue(new_value, FALSE);