mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1131867 - in /incubator/mesos/trunk/src: configuration.cpp configuration.hpp tests/test_configuration.cpp
Date Sun, 05 Jun 2011 05:42:32 GMT
Author: benh
Date: Sun Jun  5 05:42:32 2011
New Revision: 1131867

URL: http://svn.apache.org/viewvc?rev=1131867&view=rev
Log:
Renamed load* to load() as mateiz suggested.

Modified:
    incubator/mesos/trunk/src/configuration.cpp
    incubator/mesos/trunk/src/configuration.hpp
    incubator/mesos/trunk/src/tests/test_configuration.cpp

Modified: incubator/mesos/trunk/src/configuration.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/configuration.cpp?rev=1131867&r1=1131866&r2=1131867&view=diff
==============================================================================
--- incubator/mesos/trunk/src/configuration.cpp (original)
+++ incubator/mesos/trunk/src/configuration.cpp Sun Jun  5 05:42:32 2011
@@ -31,7 +31,7 @@ void Configuration::validate()
 }
 
 
-void Configuration::loadEnvCmdConf(int argc, char** argv, bool inferMesosHomeFromArg0)
+void Configuration::load(int argc, char** argv, bool inferMesosHomeFromArg0)
 {
   loadEnv();
   loadCommandLine(argc, argv, inferMesosHomeFromArg0);
@@ -40,7 +40,7 @@ void Configuration::loadEnvCmdConf(int a
 }
 
 
-void Configuration::loadEnvConf()
+void Configuration::load()
 {
   loadEnv();
   loadConfigFileIfGiven();
@@ -48,7 +48,7 @@ void Configuration::loadEnvConf()
 }
 
 
-void Configuration::loadEnvMapConf(const map<string, string>& _params) 
+void Configuration::load(const map<string, string>& _params) 
 {
   loadEnv();
   params.loadMap(_params);

Modified: incubator/mesos/trunk/src/configuration.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/configuration.hpp?rev=1131867&r1=1131866&r2=1131867&view=diff
==============================================================================
--- incubator/mesos/trunk/src/configuration.hpp (original)
+++ incubator/mesos/trunk/src/configuration.hpp Sun Jun  5 05:42:32 2011
@@ -256,7 +256,7 @@ public:
    * @param inferMesosHomeFromArg0 whether to set mesos home to directory
    *                               containing argv[0] (the program being run)
    **/
-  void loadEnvCmdConf(int argc, char** argv, bool inferMesosHomeFromArg0=false);
+  void load(int argc, char** argv, bool inferMesosHomeFromArg0=false);
 
 
   /**
@@ -270,7 +270,7 @@ public:
    * The config file should contain key=value pairs, one per line.
    * Comments, which should start with #, are ignored.
    **/
-  void loadEnvConf();
+  void load();
 
 
   /** 
@@ -288,7 +288,7 @@ public:
    *
    * @param _params map containing key value pairs to be loaded
    **/
-  void loadEnvMapConf(const map<string, string>& _params);
+  void load(const map<string, string>& _params);
 
 private:
   /**

Modified: incubator/mesos/trunk/src/tests/test_configuration.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/test_configuration.cpp?rev=1131867&r1=1131866&r2=1131867&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/test_configuration.cpp (original)
+++ incubator/mesos/trunk/src/tests/test_configuration.cpp Sun Jun  5 05:42:32 2011
@@ -23,7 +23,7 @@ TEST(ConfigurationTest, Environment)
 {
   setenv("MESOS_TEST", "working", true);
   Configuration conf;
-  conf.loadEnvConf();
+  conf.load();
   unsetenv("MESOS_TEST");
 
   EXPECT_EQ("working", conf.getParams()["test"]);
@@ -47,7 +47,7 @@ TEST(ConfigurationTest, DefaultOptions)
       conf.addOption<long>("test3", "Tests the default\noption.", 2010);
       conf.addOption("test4", "Option without default\noption.");
       conf.addOption<string>("test5", "Option with a default string.", "arb");
-      conf.loadEnvCmdConf(ARGC, argv, false);
+      conf.load(ARGC, argv, false);
     } );
   
   conf.addOption<int>("excp", "Exception tester.", 50);
@@ -77,7 +77,7 @@ TEST(ConfigurationTest, CommandLine)
   argv[9] = (char*) "--space=Long String";
 
   Configuration conf;
-  conf.loadEnvCmdConf(ARGC, argv, false);
+  conf.load(ARGC, argv, false);
 
   EXPECT_EQ("text1",       conf.getParams()["test1"]);
   EXPECT_EQ("1",           conf.getParams()["test2"]);
@@ -103,7 +103,7 @@ TEST_WITH_WORKDIR(ConfigurationTest, Con
 
   setenv("MESOS_HOME", ".", 1);
   Configuration conf;
-  conf.loadEnvConf();
+  conf.load();
   unsetenv("MESOS_HOME");
 
   EXPECT_EQ("coffee", conf.getParams()["test1"]);
@@ -123,7 +123,7 @@ TEST_WITH_WORKDIR(ConfigurationTest, Con
   file.close();
   setenv("MESOS_CONF", "conf2", 1);
   Configuration conf;
-  conf.loadEnvConf();
+  conf.load();
   unsetenv("MESOS_CONF");
 
   EXPECT_EQ("shake", conf.getParams()["test3"]);
@@ -145,7 +145,7 @@ TEST_WITH_WORKDIR(ConfigurationTest, Con
   setenv("MESOS_HOME", ".", 1);
   setenv("MESOS_CONF", "conf2", 1);
   Configuration conf;
-  conf.loadEnvConf();
+  conf.load();
   unsetenv("MESOS_CONF");
   unsetenv("MESOS_HOME");
 
@@ -174,7 +174,7 @@ TEST_WITH_WORKDIR(ConfigurationTest, Com
   argv[3] = (char*) "--d=fromCmdLine";
 
   Configuration conf;
-  conf.loadEnvCmdConf(ARGC, argv, false);
+  conf.load(ARGC, argv, false);
 
   EXPECT_EQ("1",           conf.getParams()["a"]);
   EXPECT_EQ("overridden",  conf.getParams()["b"]);
@@ -212,7 +212,7 @@ TEST_WITH_WORKDIR(ConfigurationTest, Loa
   argv[2] = (char*) "--c=fromCmdLine";
 
   Configuration conf;
-  conf.loadEnvCmdConf(ARGC, argv, false);
+  conf.load(ARGC, argv, false);
 
   // Clear the environment vars set above
   unsetenv("MESOS_HOME");



Mime
View raw message