From: Michal 'vorner' Vaner Date: Tue, 24 Jul 2012 09:00:25 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/trac1976-cont' into work/merge X-Git-Tag: trac2351_base~97^2~7^2~2^2~21^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9cef6836cd9198c1a8f20574fc07cf632ef82d1b;p=thirdparty%2Fkea.git Merge remote-tracking branch 'origin/trac1976-cont' into work/merge Conflicts: src/bin/auth/tests/datasrc_configurator_unittest.cc --- 9cef6836cd9198c1a8f20574fc07cf632ef82d1b diff --cc src/bin/auth/tests/datasrc_configurator_unittest.cc index d5ed25f29e,9c009fd4ea..12454f02f7 --- a/src/bin/auth/tests/datasrc_configurator_unittest.cc +++ b/src/bin/auth/tests/datasrc_configurator_unittest.cc @@@ -115,9 -115,15 +115,15 @@@ protected void SetUp() { init(); } + ElementPtr buildConfig(const string& config) const { + const ElementPtr internal(Element::fromJSON(config)); + const ElementPtr external(Element::fromJSON("{\"version\": 1}")); + external->set("classes", internal); + return (external); + } - void doInInit() { + void initializeINList() { const ElementPtr - config(Element::fromJSON("{\"IN\": [{\"type\": \"xxx\"}]}")); + config(buildConfig("{\"IN\": [{\"type\": \"xxx\"}]}")); session.addMessage(createCommand("config_update", config), "data_sources", "*"); mccs->checkCommand(); @@@ -161,10 -166,10 +167,10 @@@ TEST_F(DatasrcConfiguratorTest, createL TEST_F(DatasrcConfiguratorTest, modifyList) { // First, initialize the list - doInInit(); + initializeINList(); // And now change the configuration of the list const ElementPtr - config(Element::fromJSON("{\"IN\": [{\"type\": \"yyy\"}]}")); + config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}]}")); session.addMessage(createCommand("config_update", config), "data_sources", "*"); log_ = ""; @@@ -198,10 -202,10 +204,10 @@@ TEST_F(DatasrcConfiguratorTest, multipl // It's almost like above, but we initialize first with single-list // config. TEST_F(DatasrcConfiguratorTest, updateAdd) { - doInInit(); + initializeINList(); const ElementPtr - config(Element::fromJSON("{\"IN\": [{\"type\": \"yyy\"}], " - "\"CH\": [{\"type\": \"xxx\"}]}")); + config(buildConfig("{\"IN\": [{\"type\": \"yyy\"}], " + "\"CH\": [{\"type\": \"xxx\"}]}")); session.addMessage(createCommand("config_update", config), "data_sources", "*"); log_ = ""; @@@ -216,9 -220,9 +222,9 @@@ // We delete a class list in this test. TEST_F(DatasrcConfiguratorTest, updateDelete) { - doInInit(); + initializeINList(); const ElementPtr - config(Element::fromJSON("{}")); + config(buildConfig("{}")); session.addMessage(createCommand("config_update", config), "data_sources", "*"); log_ = ""; @@@ -233,11 -233,11 +239,11 @@@ // Check that we can rollback an addition if something else fails TEST_F(DatasrcConfiguratorTest, rollbackAddition) { - doInInit(); + initializeINList(); // The configuration is wrong. However, the CH one will get done first. const ElementPtr - config(Element::fromJSON("{\"IN\": [{\"type\": 13}], " - "\"CH\": [{\"type\": \"xxx\"}]}")); + config(buildConfig("{\"IN\": [{\"type\": 13}], " + "\"CH\": [{\"type\": \"xxx\"}]}")); session.addMessage(createCommand("config_update", config), "data_sources", "*"); log_ = "";