Browse Source

[3615] Applied patches attached to tickets #3615 and #3617.

The former replaces the -v with the -d parameter in D2 unit tests. This
enables the D2 tests that were skipped when the -v parameter was in use.
The -v causes D2 to print version number and exits. The other patch is
for printing configuration summary in D2 which we were not aware was failing
because tests used to be skipped with -v parameter.
Marcin Siodelski 10 years ago
parent
commit
73bafb1ffb

+ 1 - 1
src/bin/d2/tests/d2_cfg_mgr_unittests.cc

@@ -378,7 +378,7 @@ TEST_F(D2CfgMgrTest, validParamsEntry) {
               d2_params_->getIpAddress());
 
     // Verify the configuration summary.
-    EXPECT_EQ("listening on 3001::5, port 777",
+    EXPECT_EQ("listening on 3001::5, port 777, using UDP",
               d2_params_->getConfigSummary());
 }
 

+ 1 - 1
src/bin/d2/tests/d2_controller_unittests.cc

@@ -122,7 +122,7 @@ TEST_F(D2ControllerTest, commandLineArgs) {
     char* argv[] = { const_cast<char*>("progName"),
                      const_cast<char*>("-c"),
                      const_cast<char*>(DControllerTest::CFG_TEST_FILE),
-                     const_cast<char*>("-v") };
+                     const_cast<char*>("-d") };
     int argc = 4;
 
     // Verify that verbose flag is false initially.

+ 5 - 5
src/bin/d2/tests/d_controller_unittests.cc

@@ -87,7 +87,7 @@ TEST_F(DStubControllerTest, commandLineArgs) {
     char* argv[] = { const_cast<char*>("progName"),
                      const_cast<char*>("-c"),
                      const_cast<char*>("cfgName"),
-                     const_cast<char*>("-v") };
+                     const_cast<char*>("-d") };
     int argc = 4;
     EXPECT_NO_THROW(parseArgs(argc, argv));
 
@@ -174,7 +174,7 @@ TEST_F(DStubControllerTest, launchProcessInitError) {
     char* argv[] = { const_cast<char*>("progName"),
                      const_cast<char*>("-c"),
                      const_cast<char*>(DControllerTest::CFG_TEST_FILE),
-                     const_cast<char*>("-v") };
+                     const_cast<char*>("-d") };
     int argc = 4;
 
     // Launch the controller in stand alone mode.
@@ -204,7 +204,7 @@ TEST_F(DStubControllerTest, nonexistantConfigFile) {
     char* argv[] = { const_cast<char*>("progName"),
                      const_cast<char*>("-c"),
                      const_cast<char*>("bogus-file"),
-                     const_cast<char*>("-v") };
+                     const_cast<char*>("-d") };
     int argc = 4;
 
     // Record start time, and invoke launch().
@@ -216,7 +216,7 @@ TEST_F(DStubControllerTest, missingConfigFileName) {
     // command line to run standalone
     char* argv[] = { const_cast<char*>("progName"),
                      const_cast<char*>("-c"),
-                     const_cast<char*>("-v") };
+                     const_cast<char*>("-d") };
     int argc = 3;
 
     // Record start time, and invoke launch().
@@ -227,7 +227,7 @@ TEST_F(DStubControllerTest, missingConfigFileName) {
 TEST_F(DStubControllerTest, missingConfigFileArgument) {
     // command line to run standalone
     char* argv[] = { const_cast<char*>("progName"),
-                     const_cast<char*>("-v") };
+                     const_cast<char*>("-d") };
     int argc = 2;
 
     // Record start time, and invoke launch().

+ 1 - 1
src/bin/d2/tests/d_test_stubs.cc

@@ -276,7 +276,7 @@ DControllerTest::runWithConfig(const std::string& config, int run_time_ms,
         char* argv[] = { const_cast<char*>("progName"),
                          const_cast<char*>("-c"),
                          const_cast<char*>(DControllerTest::CFG_TEST_FILE),
-                         const_cast<char*>("-v") };
+                         const_cast<char*>("-d") };
         launch(4, argv);
     } catch (...) {
         // calculate elasped time, then rethrow it