mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-18 02:15:23 +00:00
clarify some variable names
This commit is contained in:
parent
47e55afae0
commit
0d90b95468
@ -45,7 +45,7 @@ namespace game_config {
|
||||
config_cache::config_cache() :
|
||||
force_valid_cache_(false),
|
||||
use_cache_(true),
|
||||
not_valid_cache_(false),
|
||||
fake_invalid_cache_(false),
|
||||
defines_map_(),
|
||||
path_defines_()
|
||||
{
|
||||
@ -199,7 +199,7 @@ namespace game_config {
|
||||
|
||||
file_tree_checksum dir_checksum;
|
||||
|
||||
if(!force_valid_cache_ && !not_valid_cache_) {
|
||||
if(!force_valid_cache_ && !fake_invalid_cache_) {
|
||||
try {
|
||||
if(file_exists(fname_checksum)) {
|
||||
DBG_CACHE << "Reading checksum: " << fname_checksum << "\n";
|
||||
@ -322,9 +322,9 @@ namespace game_config {
|
||||
return;
|
||||
}
|
||||
|
||||
void config_cache::set_force_not_valid_cache(bool force)
|
||||
void config_cache::set_force_invalid_cache(bool force)
|
||||
{
|
||||
not_valid_cache_ = force;
|
||||
fake_invalid_cache_ = force;
|
||||
}
|
||||
|
||||
void config_cache::set_use_cache(bool use)
|
||||
|
@ -98,7 +98,7 @@ namespace game_config {
|
||||
typedef std::multimap<std::string,std::string> path_define_map;
|
||||
private:
|
||||
|
||||
bool force_valid_cache_, use_cache_, not_valid_cache_;
|
||||
bool force_valid_cache_, use_cache_, fake_invalid_cache_;
|
||||
preproc_map defines_map_;
|
||||
path_define_map path_defines_;
|
||||
|
||||
@ -122,8 +122,7 @@ namespace game_config {
|
||||
protected:
|
||||
config_cache();
|
||||
|
||||
void set_force_not_valid_cache(bool);
|
||||
|
||||
void set_force_invalid_cache(bool);
|
||||
|
||||
|
||||
public:
|
||||
|
@ -65,9 +65,9 @@ class test_config_cache : public game_config::config_cache {
|
||||
return cache_;
|
||||
}
|
||||
|
||||
void set_force_not_valid_cache(bool force)
|
||||
void set_force_invalid_cache(bool force)
|
||||
{
|
||||
game_config::config_cache::set_force_not_valid_cache(force);
|
||||
game_config::config_cache::set_force_invalid_cache(force);
|
||||
}
|
||||
};
|
||||
|
||||
@ -273,7 +273,7 @@ BOOST_AUTO_TEST_CASE( test_define_loading )
|
||||
|
||||
transaction.lock();
|
||||
|
||||
cache.set_force_not_valid_cache(true);
|
||||
cache.set_force_invalid_cache(true);
|
||||
config umc_config;
|
||||
child = &umc_config.add_child("umc");
|
||||
(*child)["test"] = "umc load";
|
||||
@ -282,7 +282,7 @@ BOOST_AUTO_TEST_CASE( test_define_loading )
|
||||
child = &umc_config.add_child("test_key4");
|
||||
(*child)["defined"] = "parameter";
|
||||
BOOST_CHECK_EQUAL(umc_config, *cache.get_config("data/test/test/umc.cfg"));
|
||||
cache.set_force_not_valid_cache(false);
|
||||
cache.set_force_invalid_cache(false);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE( test_lead_spaces_loading )
|
||||
@ -290,9 +290,9 @@ BOOST_AUTO_TEST_CASE( test_lead_spaces_loading )
|
||||
config test_config;
|
||||
test_config.add_child("test_lead_space")["space"] = "empty char in middle";
|
||||
// Force reload of cache
|
||||
cache.set_force_not_valid_cache(true);
|
||||
cache.set_force_invalid_cache(true);
|
||||
BOOST_CHECK_EQUAL(test_config, *cache.get_config("data/test/test/leading_space.cfg"));
|
||||
cache.set_force_not_valid_cache(false);
|
||||
cache.set_force_invalid_cache(false);
|
||||
BOOST_CHECK_EQUAL(test_config, *cache.get_config("data/test/test/leading_space.cfg"));
|
||||
}
|
||||
|
||||
@ -302,9 +302,9 @@ BOOST_AUTO_TEST_CASE( test_performance )
|
||||
{
|
||||
test_scoped_define mp("MULTIPLAYER");
|
||||
config cfg_ref;
|
||||
// cache.set_force_not_valid_cache(true);
|
||||
// cache.set_force_invalid_cache(true);
|
||||
cache.get_config("data/", cfg_ref);
|
||||
// cache.set_force_not_valid_cache(false);
|
||||
// cache.set_force_invalid_cache(false);
|
||||
for (int i=0; i < 3; ++i)
|
||||
{
|
||||
cache.get_config("data/");
|
||||
|
Loading…
x
Reference in New Issue
Block a user