diff options
author | Shaun Verch <shaun.verch@10gen.com> | 2013-10-10 10:53:56 -0400 |
---|---|---|
committer | Shaun Verch <shaun.verch@10gen.com> | 2013-10-23 19:41:30 -0400 |
commit | 4686f81fe1ad2dc700ab17748d96e9c24f824579 (patch) | |
tree | b3d16f6d6f49622bcafb1513c31c4e52b95037ea | |
parent | 0f9712f7a666699b83cee27fa7136ea92aa9e555 (diff) | |
download | mongo-4686f81fe1ad2dc700ab17748d96e9c24f824579.tar.gz |
SERVER-11144 Add attribute to affect what sources an option can have
20 files changed, 846 insertions, 12 deletions
diff --git a/src/mongo/db/mongod_options_test.cpp b/src/mongo/db/mongod_options_test.cpp index 69d83b0e445..2ec72ca6370 100644 --- a/src/mongo/db/mongod_options_test.cpp +++ b/src/mongo/db/mongod_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "pretouch") { ASSERT_EQUALS(iterator->_singleName, "pretouch"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "command") { ASSERT_EQUALS(iterator->_singleName, "command"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "cacheSize") { ASSERT_EQUALS(iterator->_singleName, "cacheSize"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nodur") { ASSERT_EQUALS(iterator->_singleName, "nodur"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nohints") { ASSERT_EQUALS(iterator->_singleName, "nohints"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nopreallocj") { ASSERT_EQUALS(iterator->_singleName, "nopreallocj"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dur") { ASSERT_EQUALS(iterator->_singleName, "dur"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "durOptions") { ASSERT_EQUALS(iterator->_singleName, "durOptions"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "pairwith") { ASSERT_EQUALS(iterator->_singleName, "pairwith"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "arbiter") { ASSERT_EQUALS(iterator->_singleName, "arbiter"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "opIdMem") { ASSERT_EQUALS(iterator->_singleName, "opIdMem"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "help") { ASSERT_EQUALS(iterator->_singleName, "help,h"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "config") { ASSERT_EQUALS(iterator->_singleName, "config,f"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -180,6 +195,7 @@ namespace { moe::Value implicitVal(std::string("v")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -189,6 +205,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -198,6 +215,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "bind_ip") { ASSERT_EQUALS(iterator->_singleName, "bind_ip"); @@ -207,6 +225,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "maxConns") { ASSERT_EQUALS(iterator->_singleName, "maxConns"); @@ -216,6 +235,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "logpath") { ASSERT_EQUALS(iterator->_singleName, "logpath"); @@ -225,6 +245,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "syslogFacility") { ASSERT_EQUALS(iterator->_singleName, "syslogFacility"); @@ -234,6 +255,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "logappend") { ASSERT_EQUALS(iterator->_singleName, "logappend"); @@ -243,6 +265,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "logTimestampFormat") { ASSERT_EQUALS(iterator->_singleName, "logTimestampFormat"); @@ -252,6 +275,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "pidfilepath") { ASSERT_EQUALS(iterator->_singleName, "pidfilepath"); @@ -261,6 +285,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "keyFile") { ASSERT_EQUALS(iterator->_singleName, "keyFile"); @@ -270,6 +295,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "setParameter") { ASSERT_EQUALS(iterator->_singleName, "setParameter"); @@ -279,6 +305,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, true); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "httpinterface") { ASSERT_EQUALS(iterator->_singleName, "httpinterface"); @@ -288,6 +315,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "clusterAuthMode") { ASSERT_EQUALS(iterator->_singleName, "clusterAuthMode"); @@ -297,6 +325,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nounixsocket") { ASSERT_EQUALS(iterator->_singleName, "nounixsocket"); @@ -306,6 +335,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "unixSocketPrefix") { ASSERT_EQUALS(iterator->_singleName, "unixSocketPrefix"); @@ -315,6 +345,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "fork") { ASSERT_EQUALS(iterator->_singleName, "fork"); @@ -324,6 +355,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "syslog") { ASSERT_EQUALS(iterator->_singleName, "syslog"); @@ -333,6 +365,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -342,6 +375,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -351,6 +385,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -360,6 +395,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -369,6 +405,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -378,6 +415,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -387,6 +425,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -396,6 +435,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -405,6 +445,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -414,6 +455,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvvv"); @@ -423,6 +465,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvvvv"); @@ -432,6 +475,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nohttpinterface") { ASSERT_EQUALS(iterator->_singleName, "nohttpinterface"); @@ -441,6 +485,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "objcheck") { ASSERT_EQUALS(iterator->_singleName, "objcheck"); @@ -450,6 +495,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noobjcheck") { ASSERT_EQUALS(iterator->_singleName, "noobjcheck"); @@ -459,6 +505,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "traceExceptions") { ASSERT_EQUALS(iterator->_singleName, "traceExceptions"); @@ -468,6 +515,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "enableExperimentalIndexStatsCmd") { ASSERT_EQUALS(iterator->_singleName, "enableExperimentalIndexStatsCmd"); @@ -477,6 +525,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "enableExperimentalStorageDetailsCmd") { ASSERT_EQUALS(iterator->_singleName, "enableExperimentalStorageDetailsCmd"); @@ -486,6 +535,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "auth") { ASSERT_EQUALS(iterator->_singleName, "auth"); @@ -495,6 +545,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "cpu") { ASSERT_EQUALS(iterator->_singleName, "cpu"); @@ -504,6 +555,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -522,6 +574,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "diaglog") { ASSERT_EQUALS(iterator->_singleName, "diaglog"); @@ -531,6 +584,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "directoryperdb") { ASSERT_EQUALS(iterator->_singleName, "directoryperdb"); @@ -540,6 +594,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -549,6 +604,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journal") { ASSERT_EQUALS(iterator->_singleName, "journal"); @@ -558,6 +614,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journalCommitInterval") { ASSERT_EQUALS(iterator->_singleName, "journalCommitInterval"); @@ -567,6 +624,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journalOptions") { ASSERT_EQUALS(iterator->_singleName, "journalOptions"); @@ -576,6 +634,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "jsonp") { ASSERT_EQUALS(iterator->_singleName, "jsonp"); @@ -585,6 +644,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noauth") { ASSERT_EQUALS(iterator->_singleName, "noauth"); @@ -594,6 +654,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noIndexBuildRetry") { ASSERT_EQUALS(iterator->_singleName, "noIndexBuildRetry"); @@ -603,6 +664,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nojournal") { ASSERT_EQUALS(iterator->_singleName, "nojournal"); @@ -612,6 +674,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noprealloc") { ASSERT_EQUALS(iterator->_singleName, "noprealloc"); @@ -621,6 +684,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noscripting") { ASSERT_EQUALS(iterator->_singleName, "noscripting"); @@ -630,6 +694,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "notablescan") { ASSERT_EQUALS(iterator->_singleName, "notablescan"); @@ -639,6 +704,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nssize") { ASSERT_EQUALS(iterator->_singleName, "nssize"); @@ -649,6 +715,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "profile") { ASSERT_EQUALS(iterator->_singleName, "profile"); @@ -658,6 +725,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quota") { ASSERT_EQUALS(iterator->_singleName, "quota"); @@ -667,6 +735,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quotaFiles") { ASSERT_EQUALS(iterator->_singleName, "quotaFiles"); @@ -676,6 +745,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "repair") { ASSERT_EQUALS(iterator->_singleName, "repair"); @@ -685,6 +755,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "repairpath") { ASSERT_EQUALS(iterator->_singleName, "repairpath"); @@ -694,6 +765,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "rest") { ASSERT_EQUALS(iterator->_singleName, "rest"); @@ -703,6 +775,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "slowms") { ASSERT_EQUALS(iterator->_singleName, "slowms"); @@ -713,6 +786,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "smallfiles") { ASSERT_EQUALS(iterator->_singleName, "smallfiles"); @@ -722,6 +796,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "syncdelay") { ASSERT_EQUALS(iterator->_singleName, "syncdelay"); @@ -732,6 +807,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "sysinfo") { ASSERT_EQUALS(iterator->_singleName, "sysinfo"); @@ -741,6 +817,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "upgrade") { ASSERT_EQUALS(iterator->_singleName, "upgrade"); @@ -750,6 +827,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "oplogSize") { ASSERT_EQUALS(iterator->_singleName, "oplogSize"); @@ -759,6 +837,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "master") { ASSERT_EQUALS(iterator->_singleName, "master"); @@ -768,6 +847,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "slave") { ASSERT_EQUALS(iterator->_singleName, "slave"); @@ -777,6 +857,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "source") { ASSERT_EQUALS(iterator->_singleName, "source"); @@ -786,6 +867,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "only") { ASSERT_EQUALS(iterator->_singleName, "only"); @@ -795,6 +877,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "slavedelay") { ASSERT_EQUALS(iterator->_singleName, "slavedelay"); @@ -804,6 +887,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "autoresync") { ASSERT_EQUALS(iterator->_singleName, "autoresync"); @@ -813,6 +897,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "replSet") { ASSERT_EQUALS(iterator->_singleName, "replSet"); @@ -822,6 +907,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "replIndexPrefetch") { ASSERT_EQUALS(iterator->_singleName, "replIndexPrefetch"); @@ -831,6 +917,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "configsvr") { ASSERT_EQUALS(iterator->_singleName, "configsvr"); @@ -840,6 +927,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "shardsvr") { ASSERT_EQUALS(iterator->_singleName, "shardsvr"); @@ -849,6 +937,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noMoveParanoia") { ASSERT_EQUALS(iterator->_singleName, "noMoveParanoia"); @@ -858,6 +947,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "moveParanoia") { ASSERT_EQUALS(iterator->_singleName, "moveParanoia"); @@ -867,6 +957,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl.sslOnNormalPorts") { @@ -877,6 +968,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.mode") { ASSERT_EQUALS(iterator->_singleName, "sslMode"); @@ -886,6 +978,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -895,6 +988,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -905,6 +999,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.clusterFile") { ASSERT_EQUALS(iterator->_singleName, "sslClusterFile"); @@ -914,6 +1009,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.clusterPassword") { ASSERT_EQUALS(iterator->_singleName, "sslClusterPassword"); @@ -924,6 +1020,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -933,6 +1030,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -942,6 +1040,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.weakCertificateValidation") { ASSERT_EQUALS(iterator->_singleName, "sslWeakCertificateValidation"); @@ -951,6 +1050,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -960,6 +1060,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif #ifdef _WIN32 @@ -971,6 +1072,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "remove") { ASSERT_EQUALS(iterator->_singleName, "remove"); @@ -980,6 +1082,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "reinstall") { ASSERT_EQUALS(iterator->_singleName, "reinstall"); @@ -989,6 +1092,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceName") { ASSERT_EQUALS(iterator->_singleName, "serviceName"); @@ -998,6 +1102,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceDisplayName") { ASSERT_EQUALS(iterator->_singleName, "serviceDisplayName"); @@ -1007,6 +1112,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceDescription") { ASSERT_EQUALS(iterator->_singleName, "serviceDescription"); @@ -1016,6 +1122,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceUser") { ASSERT_EQUALS(iterator->_singleName, "serviceUser"); @@ -1025,6 +1132,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "servicePassword") { ASSERT_EQUALS(iterator->_singleName, "servicePassword"); @@ -1034,6 +1142,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "service") { ASSERT_EQUALS(iterator->_singleName, "service"); @@ -1043,6 +1152,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/dbtests/framework_options_test.cpp b/src/mongo/dbtests/framework_options_test.cpp index b599b4d3a24..89c3757b5ba 100644 --- a/src/mongo/dbtests/framework_options_test.cpp +++ b/src/mongo/dbtests/framework_options_test.cpp @@ -50,6 +50,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -60,6 +61,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "debug") { ASSERT_EQUALS(iterator->_singleName, "debug"); @@ -69,6 +71,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "list") { ASSERT_EQUALS(iterator->_singleName, "list,l"); @@ -78,6 +81,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "bigfiles") { ASSERT_EQUALS(iterator->_singleName, "bigfiles"); @@ -87,6 +91,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "filter") { ASSERT_EQUALS(iterator->_singleName, "filter,f"); @@ -96,6 +101,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -105,6 +111,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "useNewQueryFramework") { ASSERT_EQUALS(iterator->_singleName, "useNewQueryFramework"); @@ -114,6 +121,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dur") { ASSERT_EQUALS(iterator->_singleName, "dur"); @@ -123,6 +131,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nodur") { ASSERT_EQUALS(iterator->_singleName, "nodur"); @@ -132,6 +141,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "seed") { ASSERT_EQUALS(iterator->_singleName, "seed"); @@ -141,6 +151,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "runs") { ASSERT_EQUALS(iterator->_singleName, "runs"); @@ -150,6 +161,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "perfHist") { ASSERT_EQUALS(iterator->_singleName, "perfHist"); @@ -159,6 +171,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "suites") { ASSERT_EQUALS(iterator->_singleName, "suites"); @@ -168,6 +181,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nopreallocj") { ASSERT_EQUALS(iterator->_singleName, "nopreallocj"); @@ -177,6 +191,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else { ::mongo::StringBuilder sb; diff --git a/src/mongo/s/mongos_options_test.cpp b/src/mongo/s/mongos_options_test.cpp index eaf1be922e6..fcd8dae1536 100644 --- a/src/mongo/s/mongos_options_test.cpp +++ b/src/mongo/s/mongos_options_test.cpp @@ -64,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "help") { ASSERT_EQUALS(iterator->_singleName, "help,h"); @@ -73,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -82,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "config") { ASSERT_EQUALS(iterator->_singleName, "config,f"); @@ -91,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -101,6 +105,7 @@ namespace { moe::Value implicitVal(std::string("v")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -110,6 +115,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -119,6 +125,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "bind_ip") { ASSERT_EQUALS(iterator->_singleName, "bind_ip"); @@ -128,6 +135,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "maxConns") { ASSERT_EQUALS(iterator->_singleName, "maxConns"); @@ -137,6 +145,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "logpath") { ASSERT_EQUALS(iterator->_singleName, "logpath"); @@ -146,6 +155,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "syslogFacility") { ASSERT_EQUALS(iterator->_singleName, "syslogFacility"); @@ -155,6 +165,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "logappend") { ASSERT_EQUALS(iterator->_singleName, "logappend"); @@ -164,6 +175,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "logTimestampFormat") { ASSERT_EQUALS(iterator->_singleName, "logTimestampFormat"); @@ -173,6 +185,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "pidfilepath") { ASSERT_EQUALS(iterator->_singleName, "pidfilepath"); @@ -182,6 +195,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "keyFile") { ASSERT_EQUALS(iterator->_singleName, "keyFile"); @@ -191,6 +205,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "setParameter") { ASSERT_EQUALS(iterator->_singleName, "setParameter"); @@ -200,6 +215,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, true); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "httpinterface") { ASSERT_EQUALS(iterator->_singleName, "httpinterface"); @@ -209,6 +225,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "clusterAuthMode") { ASSERT_EQUALS(iterator->_singleName, "clusterAuthMode"); @@ -218,6 +235,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nounixsocket") { ASSERT_EQUALS(iterator->_singleName, "nounixsocket"); @@ -227,6 +245,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "unixSocketPrefix") { ASSERT_EQUALS(iterator->_singleName, "unixSocketPrefix"); @@ -236,6 +255,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "fork") { ASSERT_EQUALS(iterator->_singleName, "fork"); @@ -245,6 +265,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "syslog") { ASSERT_EQUALS(iterator->_singleName, "syslog"); @@ -254,6 +275,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -263,6 +285,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -272,6 +295,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -281,6 +305,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -290,6 +315,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -299,6 +325,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -308,6 +335,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -317,6 +345,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -326,6 +355,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -335,6 +365,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvvv"); @@ -344,6 +375,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvvvv"); @@ -353,6 +385,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nohttpinterface") { ASSERT_EQUALS(iterator->_singleName, "nohttpinterface"); @@ -362,6 +395,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "objcheck") { ASSERT_EQUALS(iterator->_singleName, "objcheck"); @@ -371,6 +405,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noobjcheck") { ASSERT_EQUALS(iterator->_singleName, "noobjcheck"); @@ -380,6 +415,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "traceExceptions") { ASSERT_EQUALS(iterator->_singleName, "traceExceptions"); @@ -389,6 +425,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "enableExperimentalIndexStatsCmd") { ASSERT_EQUALS(iterator->_singleName, "enableExperimentalIndexStatsCmd"); @@ -398,6 +435,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "enableExperimentalStorageDetailsCmd") { ASSERT_EQUALS(iterator->_singleName, "enableExperimentalStorageDetailsCmd"); @@ -407,6 +445,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "configdb") { ASSERT_EQUALS(iterator->_singleName, "configdb"); @@ -416,6 +455,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "localThreshold") { ASSERT_EQUALS(iterator->_singleName, "localThreshold"); @@ -425,6 +465,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "test") { ASSERT_EQUALS(iterator->_singleName, "test"); @@ -434,6 +475,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "upgrade") { ASSERT_EQUALS(iterator->_singleName, "upgrade"); @@ -443,6 +485,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "chunkSize") { ASSERT_EQUALS(iterator->_singleName, "chunkSize"); @@ -452,6 +495,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -461,6 +505,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "jsonp") { ASSERT_EQUALS(iterator->_singleName, "jsonp"); @@ -470,6 +515,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noscripting") { ASSERT_EQUALS(iterator->_singleName, "noscripting"); @@ -479,6 +525,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl.sslOnNormalPorts") { @@ -489,6 +536,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.mode") { ASSERT_EQUALS(iterator->_singleName, "sslMode"); @@ -498,6 +546,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -507,6 +556,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -517,6 +567,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.clusterFile") { ASSERT_EQUALS(iterator->_singleName, "sslClusterFile"); @@ -526,6 +577,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.clusterPassword") { ASSERT_EQUALS(iterator->_singleName, "sslClusterPassword"); @@ -536,6 +588,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -545,6 +598,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -554,6 +608,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.weakCertificateValidation") { ASSERT_EQUALS(iterator->_singleName, "sslWeakCertificateValidation"); @@ -563,6 +618,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -572,6 +628,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif #ifdef _WIN32 @@ -583,6 +640,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "remove") { ASSERT_EQUALS(iterator->_singleName, "remove"); @@ -592,6 +650,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "reinstall") { ASSERT_EQUALS(iterator->_singleName, "reinstall"); @@ -601,6 +660,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceName") { ASSERT_EQUALS(iterator->_singleName, "serviceName"); @@ -610,6 +670,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceDisplayName") { ASSERT_EQUALS(iterator->_singleName, "serviceDisplayName"); @@ -619,6 +680,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceDescription") { ASSERT_EQUALS(iterator->_singleName, "serviceDescription"); @@ -628,6 +690,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "serviceUser") { ASSERT_EQUALS(iterator->_singleName, "serviceUser"); @@ -637,6 +700,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "servicePassword") { ASSERT_EQUALS(iterator->_singleName, "servicePassword"); @@ -646,6 +710,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "service") { ASSERT_EQUALS(iterator->_singleName, "service"); @@ -655,6 +720,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/shell/shell_options_test.cpp b/src/mongo/shell/shell_options_test.cpp index 0f61be2be7d..381ac305aec 100644 --- a/src/mongo/shell/shell_options_test.cpp +++ b/src/mongo/shell/shell_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nodb") { ASSERT_EQUALS(iterator->_singleName, "nodb"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "norc") { ASSERT_EQUALS(iterator->_singleName, "norc"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "eval") { ASSERT_EQUALS(iterator->_singleName, "eval"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -117,6 +125,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -127,6 +136,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -137,6 +147,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "help") { ASSERT_EQUALS(iterator->_singleName, "help,h"); @@ -146,6 +157,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -155,6 +167,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose"); @@ -164,6 +177,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -173,6 +187,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbaddress") { ASSERT_EQUALS(iterator->_singleName, "dbaddress"); @@ -182,6 +197,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "files") { ASSERT_EQUALS(iterator->_singleName, "files"); @@ -191,6 +207,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "nokillop") { ASSERT_EQUALS(iterator->_singleName, "nokillop"); @@ -200,6 +217,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "autokillop") { ASSERT_EQUALS(iterator->_singleName, "autokillop"); @@ -209,6 +227,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -219,6 +238,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -228,6 +248,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -237,6 +258,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -246,6 +268,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -255,6 +278,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -264,6 +288,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/bsondump_options_test.cpp b/src/mongo/tools/bsondump_options_test.cpp index ff65fc012ef..611c831ec16 100644 --- a/src/mongo/tools/bsondump_options_test.cpp +++ b/src/mongo/tools/bsondump_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "objcheck") { ASSERT_EQUALS(iterator->_singleName, "objcheck"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noobjcheck") { ASSERT_EQUALS(iterator->_singleName, "noobjcheck"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "filter") { ASSERT_EQUALS(iterator->_singleName, "filter"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "type") { ASSERT_EQUALS(iterator->_singleName, "type"); @@ -189,6 +205,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "file") { ASSERT_EQUALS(iterator->_singleName, "file"); @@ -198,6 +215,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceCommandLine); } else { ::mongo::StringBuilder sb; diff --git a/src/mongo/tools/mongobridge_options_test.cpp b/src/mongo/tools/mongobridge_options_test.cpp index 12bbd37cd9d..f8aa60a7a27 100644 --- a/src/mongo/tools/mongobridge_options_test.cpp +++ b/src/mongo/tools/mongobridge_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dest") { ASSERT_EQUALS(iterator->_singleName, "dest"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "delay") { ASSERT_EQUALS(iterator->_singleName, "delay"); @@ -72,6 +75,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else { ::mongo::StringBuilder sb; diff --git a/src/mongo/tools/mongodump_options_test.cpp b/src/mongo/tools/mongodump_options_test.cpp index 173c105214c..035bb16f624 100644 --- a/src/mongo/tools/mongodump_options_test.cpp +++ b/src/mongo/tools/mongodump_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "directoryperdb") { ASSERT_EQUALS(iterator->_singleName, "directoryperdb"); @@ -236,6 +257,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journal") { ASSERT_EQUALS(iterator->_singleName, "journal"); @@ -245,6 +267,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "db") { ASSERT_EQUALS(iterator->_singleName, "db,d"); @@ -254,6 +277,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "collection") { ASSERT_EQUALS(iterator->_singleName, "collection,c"); @@ -263,6 +287,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "out") { ASSERT_EQUALS(iterator->_singleName, "out,o"); @@ -273,6 +298,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "query") { ASSERT_EQUALS(iterator->_singleName, "query,q"); @@ -282,6 +308,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "oplog") { ASSERT_EQUALS(iterator->_singleName, "oplog"); @@ -291,6 +318,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "repair") { ASSERT_EQUALS(iterator->_singleName, "repair"); @@ -300,6 +328,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "forceTableScan") { ASSERT_EQUALS(iterator->_singleName, "forceTableScan"); @@ -309,6 +338,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -319,6 +349,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -328,6 +359,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -337,6 +369,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -346,6 +379,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -355,6 +389,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -364,6 +399,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/mongoexport_options_test.cpp b/src/mongo/tools/mongoexport_options_test.cpp index 2886109b5c0..1e29197ebd7 100644 --- a/src/mongo/tools/mongoexport_options_test.cpp +++ b/src/mongo/tools/mongoexport_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "directoryperdb") { ASSERT_EQUALS(iterator->_singleName, "directoryperdb"); @@ -236,6 +257,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journal") { ASSERT_EQUALS(iterator->_singleName, "journal"); @@ -245,6 +267,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "db") { ASSERT_EQUALS(iterator->_singleName, "db,d"); @@ -254,6 +277,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "collection") { ASSERT_EQUALS(iterator->_singleName, "collection,c"); @@ -263,6 +287,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "fields") { ASSERT_EQUALS(iterator->_singleName, "fields,f"); @@ -272,6 +297,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "fieldFile") { ASSERT_EQUALS(iterator->_singleName, "fieldFile"); @@ -281,6 +307,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "query") { ASSERT_EQUALS(iterator->_singleName, "query,q"); @@ -290,6 +317,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "csv") { ASSERT_EQUALS(iterator->_singleName, "csv"); @@ -299,6 +327,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "out") { ASSERT_EQUALS(iterator->_singleName, "out,o"); @@ -308,6 +337,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "jsonArray") { ASSERT_EQUALS(iterator->_singleName, "jsonArray"); @@ -317,6 +347,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "slaveOk") { ASSERT_EQUALS(iterator->_singleName, "slaveOk,k"); @@ -327,6 +358,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "forceTableScan") { ASSERT_EQUALS(iterator->_singleName, "forceTableScan"); @@ -336,6 +368,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "skip") { ASSERT_EQUALS(iterator->_singleName, "skip"); @@ -346,6 +379,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "limit") { ASSERT_EQUALS(iterator->_singleName, "limit"); @@ -356,6 +390,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -366,6 +401,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -375,6 +411,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -384,6 +421,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -393,6 +431,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -402,6 +441,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -411,6 +451,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/mongofiles_options_test.cpp b/src/mongo/tools/mongofiles_options_test.cpp index ba7aaf03382..d307fda9d3e 100644 --- a/src/mongo/tools/mongofiles_options_test.cpp +++ b/src/mongo/tools/mongofiles_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "directoryperdb") { ASSERT_EQUALS(iterator->_singleName, "directoryperdb"); @@ -236,6 +257,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journal") { ASSERT_EQUALS(iterator->_singleName, "journal"); @@ -245,6 +267,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "db") { ASSERT_EQUALS(iterator->_singleName, "db,d"); @@ -254,6 +277,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "collection") { ASSERT_EQUALS(iterator->_singleName, "collection,c"); @@ -263,6 +287,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "local") { ASSERT_EQUALS(iterator->_singleName, "local,l"); @@ -272,6 +297,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "type") { ASSERT_EQUALS(iterator->_singleName, "type,t"); @@ -281,6 +307,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "replace") { ASSERT_EQUALS(iterator->_singleName, "replace,r"); @@ -290,6 +317,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "command") { ASSERT_EQUALS(iterator->_singleName, "command"); @@ -299,6 +327,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceCommandLine); } else if (iterator->_dottedName == "file") { ASSERT_EQUALS(iterator->_singleName, "file"); @@ -308,6 +337,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceCommandLine); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -318,6 +348,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -327,6 +358,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -336,6 +368,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -345,6 +378,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -354,6 +388,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -363,6 +398,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/mongoimport_options_test.cpp b/src/mongo/tools/mongoimport_options_test.cpp index c3dabaade50..93d8c08c4a0 100644 --- a/src/mongo/tools/mongoimport_options_test.cpp +++ b/src/mongo/tools/mongoimport_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "directoryperdb") { ASSERT_EQUALS(iterator->_singleName, "directoryperdb"); @@ -236,6 +257,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journal") { ASSERT_EQUALS(iterator->_singleName, "journal"); @@ -245,6 +267,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "db") { ASSERT_EQUALS(iterator->_singleName, "db,d"); @@ -254,6 +277,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "collection") { ASSERT_EQUALS(iterator->_singleName, "collection,c"); @@ -263,6 +287,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "fields") { ASSERT_EQUALS(iterator->_singleName, "fields,f"); @@ -272,6 +297,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "fieldFile") { ASSERT_EQUALS(iterator->_singleName, "fieldFile"); @@ -281,6 +307,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ignoreBlanks") { ASSERT_EQUALS(iterator->_singleName, "ignoreBlanks"); @@ -290,6 +317,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "type") { ASSERT_EQUALS(iterator->_singleName, "type"); @@ -299,6 +327,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "file") { ASSERT_EQUALS(iterator->_singleName, "file"); @@ -308,6 +337,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "drop") { ASSERT_EQUALS(iterator->_singleName, "drop"); @@ -317,6 +347,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "headerline") { ASSERT_EQUALS(iterator->_singleName, "headerline"); @@ -326,6 +357,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "upsert") { ASSERT_EQUALS(iterator->_singleName, "upsert"); @@ -335,6 +367,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "upsertFields") { ASSERT_EQUALS(iterator->_singleName, "upsertFields"); @@ -344,6 +377,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "stopOnError") { ASSERT_EQUALS(iterator->_singleName, "stopOnError"); @@ -353,6 +387,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "jsonArray") { ASSERT_EQUALS(iterator->_singleName, "jsonArray"); @@ -362,6 +397,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noimport") { ASSERT_EQUALS(iterator->_singleName, "noimport"); @@ -371,6 +407,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -381,6 +418,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -390,6 +428,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -399,6 +438,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -408,6 +448,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -417,6 +458,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -426,6 +468,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/mongooplog_options_test.cpp b/src/mongo/tools/mongooplog_options_test.cpp index bd00a7e6654..a353ed2cf47 100644 --- a/src/mongo/tools/mongooplog_options_test.cpp +++ b/src/mongo/tools/mongooplog_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "directoryperdb") { ASSERT_EQUALS(iterator->_singleName, "directoryperdb"); @@ -236,6 +257,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journal") { ASSERT_EQUALS(iterator->_singleName, "journal"); @@ -245,6 +267,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "db") { ASSERT_EQUALS(iterator->_singleName, "db,d"); @@ -254,6 +277,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "collection") { ASSERT_EQUALS(iterator->_singleName, "collection,c"); @@ -263,6 +287,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "seconds") { ASSERT_EQUALS(iterator->_singleName, "seconds,s"); @@ -272,6 +297,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "from") { ASSERT_EQUALS(iterator->_singleName, "from"); @@ -281,6 +307,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "oplogns") { ASSERT_EQUALS(iterator->_singleName, "oplogns"); @@ -291,6 +318,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -301,6 +329,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -310,6 +339,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -319,6 +349,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -328,6 +359,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -337,6 +369,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -346,6 +379,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/mongorestore_options_test.cpp b/src/mongo/tools/mongorestore_options_test.cpp index d1b854f86c4..e85021cb25f 100644 --- a/src/mongo/tools/mongorestore_options_test.cpp +++ b/src/mongo/tools/mongorestore_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dbpath") { ASSERT_EQUALS(iterator->_singleName, "dbpath"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "directoryperdb") { ASSERT_EQUALS(iterator->_singleName, "directoryperdb"); @@ -236,6 +257,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "journal") { ASSERT_EQUALS(iterator->_singleName, "journal"); @@ -245,6 +267,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "db") { ASSERT_EQUALS(iterator->_singleName, "db,d"); @@ -254,6 +277,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "collection") { ASSERT_EQUALS(iterator->_singleName, "collection,c"); @@ -263,6 +287,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "objcheck") { ASSERT_EQUALS(iterator->_singleName, "objcheck"); @@ -272,6 +297,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noobjcheck") { ASSERT_EQUALS(iterator->_singleName, "noobjcheck"); @@ -281,6 +307,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "filter") { ASSERT_EQUALS(iterator->_singleName, "filter"); @@ -290,6 +317,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "drop") { ASSERT_EQUALS(iterator->_singleName, "drop"); @@ -299,6 +327,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "oplogReplay") { ASSERT_EQUALS(iterator->_singleName, "oplogReplay"); @@ -308,6 +337,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "oplogLimit") { ASSERT_EQUALS(iterator->_singleName, "oplogLimit"); @@ -317,6 +347,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "keepIndexVersion") { ASSERT_EQUALS(iterator->_singleName, "keepIndexVersion"); @@ -326,6 +357,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noOptionsRestore") { ASSERT_EQUALS(iterator->_singleName, "noOptionsRestore"); @@ -335,6 +367,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noIndexRestore") { ASSERT_EQUALS(iterator->_singleName, "noIndexRestore"); @@ -344,6 +377,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "w") { ASSERT_EQUALS(iterator->_singleName, "w"); @@ -354,6 +388,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "dir") { ASSERT_EQUALS(iterator->_singleName, "dir"); @@ -364,6 +399,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "indexesLast") { ASSERT_EQUALS(iterator->_singleName, "indexesLast"); @@ -373,6 +409,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -383,6 +420,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -392,6 +430,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -401,6 +440,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -410,6 +450,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -419,6 +460,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -428,6 +470,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/mongostat_options_test.cpp b/src/mongo/tools/mongostat_options_test.cpp index a067162c664..9c1969494f2 100644 --- a/src/mongo/tools/mongostat_options_test.cpp +++ b/src/mongo/tools/mongostat_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "noheaders") { ASSERT_EQUALS(iterator->_singleName, "noheaders"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "rowcount") { ASSERT_EQUALS(iterator->_singleName, "rowcount,n"); @@ -237,6 +258,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "http") { ASSERT_EQUALS(iterator->_singleName, "http"); @@ -246,6 +268,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "discover") { ASSERT_EQUALS(iterator->_singleName, "discover"); @@ -255,6 +278,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "all") { ASSERT_EQUALS(iterator->_singleName, "all"); @@ -264,6 +288,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "sleep") { ASSERT_EQUALS(iterator->_singleName, "sleep"); @@ -273,6 +298,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceCommandLine); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -283,6 +309,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -292,6 +319,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -301,6 +329,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -310,6 +339,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -319,6 +349,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -328,6 +359,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/tools/mongotop_options_test.cpp b/src/mongo/tools/mongotop_options_test.cpp index 55af3e319e5..e7277b7432e 100644 --- a/src/mongo/tools/mongotop_options_test.cpp +++ b/src/mongo/tools/mongotop_options_test.cpp @@ -44,6 +44,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "verbose") { ASSERT_EQUALS(iterator->_singleName, "verbose,v"); @@ -53,6 +54,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "quiet") { ASSERT_EQUALS(iterator->_singleName, "quiet"); @@ -62,6 +64,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "version") { ASSERT_EQUALS(iterator->_singleName, "version"); @@ -71,6 +74,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vv") { ASSERT_EQUALS(iterator->_singleName, "vv"); @@ -80,6 +84,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvv") { ASSERT_EQUALS(iterator->_singleName, "vvv"); @@ -89,6 +94,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvv"); @@ -98,6 +104,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvv"); @@ -107,6 +114,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvv"); @@ -116,6 +124,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvv"); @@ -125,6 +134,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvv"); @@ -134,6 +144,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvv"); @@ -143,6 +154,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "vvvvvvvvvv") { ASSERT_EQUALS(iterator->_singleName, "vvvvvvvvvv"); @@ -152,6 +164,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "host") { ASSERT_EQUALS(iterator->_singleName, "host,h"); @@ -161,6 +174,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "port") { ASSERT_EQUALS(iterator->_singleName, "port"); @@ -170,6 +184,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ipv6") { ASSERT_EQUALS(iterator->_singleName, "ipv6"); @@ -179,6 +194,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "username") { ASSERT_EQUALS(iterator->_singleName, "username,u"); @@ -188,6 +204,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "password") { ASSERT_EQUALS(iterator->_singleName, "password,p"); @@ -198,6 +215,7 @@ namespace { moe::Value implicitVal(std::string("")); ASSERT_TRUE(iterator->_implicit.equal(implicitVal)); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationDatabase") { ASSERT_EQUALS(iterator->_singleName, "authenticationDatabase"); @@ -208,6 +226,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "authenticationMechanism") { ASSERT_EQUALS(iterator->_singleName, "authenticationMechanism"); @@ -218,6 +237,7 @@ namespace { ASSERT_TRUE(iterator->_default.equal(defaultVal)); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "locks") { ASSERT_EQUALS(iterator->_singleName, "locks"); @@ -227,6 +247,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "sleep") { ASSERT_EQUALS(iterator->_singleName, "sleep"); @@ -236,6 +257,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceCommandLine); } #ifdef MONGO_SSL else if (iterator->_dottedName == "ssl") { @@ -246,6 +268,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CAFile") { ASSERT_EQUALS(iterator->_singleName, "sslCAFile"); @@ -255,6 +278,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyFile") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyFile"); @@ -264,6 +288,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.PEMKeyPassword") { ASSERT_EQUALS(iterator->_singleName, "sslPEMKeyPassword"); @@ -273,6 +298,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.CRLFile") { ASSERT_EQUALS(iterator->_singleName, "sslCRLFile"); @@ -282,6 +308,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } else if (iterator->_dottedName == "ssl.FIPSMode") { ASSERT_EQUALS(iterator->_singleName, "sslFIPSMode"); @@ -291,6 +318,7 @@ namespace { ASSERT_TRUE(iterator->_default.isEmpty()); ASSERT_TRUE(iterator->_implicit.isEmpty()); ASSERT_EQUALS(iterator->_isComposing, false); + ASSERT_EQUALS(iterator->_sources, moe::SourceAll); } #endif else { diff --git a/src/mongo/util/options_parser/option_description.cpp b/src/mongo/util/options_parser/option_description.cpp index 6129d68597d..a98b33f1d6c 100644 --- a/src/mongo/util/options_parser/option_description.cpp +++ b/src/mongo/util/options_parser/option_description.cpp @@ -167,5 +167,10 @@ namespace optionenvironment { return *this; } + OptionDescription& OptionDescription::setSources(OptionSources sources) { + _sources = sources; + return *this; + } + } // namespace optionenvironment } // namespace mongo diff --git a/src/mongo/util/options_parser/option_description.h b/src/mongo/util/options_parser/option_description.h index 56fadd93338..8068665b265 100644 --- a/src/mongo/util/options_parser/option_description.h +++ b/src/mongo/util/options_parser/option_description.h @@ -39,6 +39,18 @@ namespace optionenvironment { }; /** + * An OptionSources is an enum representing where an option can come from + */ + enum OptionSources { + SourceCommandLine = 1, + SourceINIConfig = 2, + SourceJSONConfig = 4, + SourceAllConfig = SourceINIConfig | SourceJSONConfig, + SourceAllLegacy = SourceINIConfig | SourceCommandLine, + SourceAll = SourceCommandLine | SourceINIConfig | SourceJSONConfig + }; + + /** * The OptionDescription and PositionalOptionDescription classes are containers for information * about the options we are expecting either on the command line or in config files. These * should be registered in an OptionSection instance and passed to an OptionsParser. @@ -56,7 +68,8 @@ namespace optionenvironment { _isVisible(true), _default(Value()), _implicit(Value()), - _isComposing(false) { } + _isComposing(false), + _sources(SourceAll) { } /* * The following functions are part of the chaining interface for option registration. See @@ -95,6 +108,12 @@ namespace optionenvironment { */ OptionDescription& composing(); + /* + * Specify the allowed sources for this option, such as CommandLine, JSONConfig, or + * INIConfig. The default is SourceAll which means the option can be present in any source + */ + OptionDescription& setSources(OptionSources sources); + std::string _dottedName; // Used for JSON config and in Environment std::string _singleName; // Used for boost command line and INI OptionType _type; // Storage type of the argument value, or switch type (bool) @@ -104,6 +123,8 @@ namespace optionenvironment { Value _default; // Value if option is not specified Value _implicit; // Value if option is specified with no argument bool _isComposing; // Aggregate values from different sources instead of overriding + OptionSources _sources; // Places where an option can be specified (current sources are + // command line, json config, and ini config) }; class PositionalOptionDescription { diff --git a/src/mongo/util/options_parser/option_section.cpp b/src/mongo/util/options_parser/option_section.cpp index bfd41d507b3..f6819549d9f 100644 --- a/src/mongo/util/options_parser/option_section.cpp +++ b/src/mongo/util/options_parser/option_section.cpp @@ -98,7 +98,9 @@ namespace optionenvironment { try { addOptionChaining(positionalOption._name, positionalOption._name, - positionalOption._type, "hidden description").hidden(); + positionalOption._type, "hidden description") + .hidden() + .setSources(SourceCommandLine); } catch (DBException &e) { return e.toStatus(); @@ -370,11 +372,15 @@ namespace optionenvironment { Status OptionSection::getBoostOptions(po::options_description* boostOptions, bool visibleOnly, - bool includeDefaults) const { + bool includeDefaults, + OptionSources sources) const { std::list<OptionDescription>::const_iterator oditerator; for (oditerator = _options.begin(); oditerator != _options.end(); oditerator++) { - if (!visibleOnly || (oditerator->_isVisible)) { + // Only include this option if it matches the sources we specified and the option is + // either visible or we are requesting hidden options + if ((!visibleOnly || (oditerator->_isVisible)) && + (oditerator->_sources & sources)) { std::auto_ptr<po::value_semantic> boostType; Status ret = typeToBoostType(&boostType, oditerator->_type, diff --git a/src/mongo/util/options_parser/option_section.h b/src/mongo/util/options_parser/option_section.h index 05d3a807c0f..9dfcefd66ee 100644 --- a/src/mongo/util/options_parser/option_section.h +++ b/src/mongo/util/options_parser/option_section.h @@ -79,14 +79,20 @@ namespace optionenvironment { * Add an option to this section, and returns a reference to an OptionDescription to allow * for chaining. * - * Example: + * Examples: * * options.addOptionChaining("option", "option", moe::String, "Chaining Registration") * .hidden().setDefault(moe::Value("default")) - * .setImplicit(moe::Value("implicit")).composing(); + * .setImplicit(moe::Value("implicit")); * - * This creates a hidden option that is composing and has default and implicit values. See - * the OptionDescription class for details on these attributes. + * This creates a hidden option that has default and implicit values. + * + * options.addOptionChaining("name", "name", moe::String, "Composing Option") + * .composing().sources(SourceAllConfig); + * + * This creates an option that is composing and can be specified only in config files. + * + * See the OptionDescription class for details on the supported attributes. * * throws DBException on errors, such as attempting to register an option with the same name * as another option. These represent programming errors that should not happen during @@ -110,7 +116,8 @@ namespace optionenvironment { // These functions are used by the OptionsParser to make calls into boost::program_options Status getBoostOptions(po::options_description* boostOptions, bool visibleOnly = false, - bool includeDefaults = false) const; + bool includeDefaults = false, + OptionSources = SourceAll) const; Status getBoostPositionalOptions( po::positional_options_description* boostPositionalOptions) const; diff --git a/src/mongo/util/options_parser/options_parser.cpp b/src/mongo/util/options_parser/options_parser.cpp index 96bda76e445..3725d7a7ffc 100644 --- a/src/mongo/util/options_parser/options_parser.cpp +++ b/src/mongo/util/options_parser/options_parser.cpp @@ -167,7 +167,7 @@ namespace optionenvironment { for(std::vector<OptionDescription>::const_iterator iterator = options_vector.begin(); iterator != options_vector.end(); iterator++) { - if (key == iterator->_dottedName) { + if (key == iterator->_dottedName && (iterator->_sources & SourceJSONConfig)) { return Status::OK(); } } @@ -463,7 +463,7 @@ namespace optionenvironment { po::command_line_style::allow_long_disguise) ^ po::command_line_style::allow_sticky); - Status ret = options.getBoostOptions(&boostOptions); + Status ret = options.getBoostOptions(&boostOptions, false, false, SourceCommandLine); if (!ret.isOK()) { return ret; } @@ -512,7 +512,7 @@ namespace optionenvironment { po::options_description boostOptions; po::variables_map vm; - Status ret = options.getBoostOptions(&boostOptions); + Status ret = options.getBoostOptions(&boostOptions, false, false, SourceINIConfig); if (!ret.isOK()) { return ret; } diff --git a/src/mongo/util/options_parser/options_parser_test.cpp b/src/mongo/util/options_parser/options_parser_test.cpp index 5171a33669e..1537c66f5c7 100644 --- a/src/mongo/util/options_parser/options_parser_test.cpp +++ b/src/mongo/util/options_parser/options_parser_test.cpp @@ -1867,4 +1867,268 @@ namespace { } } + TEST(OptionSources, SourceCommandLine) { + OptionsParserTester parser; + moe::Environment environment; + moe::Value value; + std::vector<std::string> argv; + std::map<std::string, std::string> env_map; + std::string parameter; + + moe::OptionSection testOpts; + testOpts.addOptionChaining("config", "config", moe::String, "Config file to parse"); + testOpts.addOptionChaining("parameter", "parameter", moe::String, "Parameter") + .setSources(moe::SourceCommandLine); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--parameter"); + argv.push_back("allowed"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.json"); + + parser.setConfig("config.json", "{ parameter : \"disallowed\" }"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.ini"); + + parser.setConfig("config.ini", "parameter=disallowed"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + } + + TEST(OptionSources, SourceINIConfig) { + OptionsParserTester parser; + moe::Environment environment; + moe::Value value; + std::vector<std::string> argv; + std::map<std::string, std::string> env_map; + std::string parameter; + + moe::OptionSection testOpts; + testOpts.addOptionChaining("config", "config", moe::String, "Config file to parse"); + testOpts.addOptionChaining("parameter", "parameter", moe::String, "Parameter") + .setSources(moe::SourceINIConfig); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--parameter"); + argv.push_back("disallowed"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.json"); + + parser.setConfig("config.json", "{ parameter : \"disallowed\" }"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.ini"); + + parser.setConfig("config.ini", "parameter=allowed"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + + } + + TEST(OptionSources, SourceJSONConfig) { + OptionsParserTester parser; + moe::Environment environment; + moe::Value value; + std::vector<std::string> argv; + std::map<std::string, std::string> env_map; + std::string parameter; + + moe::OptionSection testOpts; + testOpts.addOptionChaining("config", "config", moe::String, "Config file to parse"); + testOpts.addOptionChaining("parameter", "parameter", moe::String, "Parameter") + .setSources(moe::SourceJSONConfig); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--parameter"); + argv.push_back("disallowed"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.json"); + + parser.setConfig("config.json", "{ parameter : \"allowed\" }"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.ini"); + + parser.setConfig("config.ini", "parameter=disallowed"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + } + + TEST(OptionSources, SourceAllConfig) { + OptionsParserTester parser; + moe::Environment environment; + moe::Value value; + std::vector<std::string> argv; + std::map<std::string, std::string> env_map; + std::string parameter; + + moe::OptionSection testOpts; + testOpts.addOptionChaining("config", "config", moe::String, "Config file to parse"); + testOpts.addOptionChaining("parameter", "parameter", moe::String, "Parameter") + .setSources(moe::SourceAllConfig); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--parameter"); + argv.push_back("disallowed"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.json"); + + parser.setConfig("config.json", "{ parameter : \"allowed\" }"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.ini"); + + parser.setConfig("config.ini", "parameter=allowed"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + } + + TEST(OptionSources, SourceAllLegacy) { + OptionsParserTester parser; + moe::Environment environment; + moe::Value value; + std::vector<std::string> argv; + std::map<std::string, std::string> env_map; + std::string parameter; + + moe::OptionSection testOpts; + testOpts.addOptionChaining("config", "config", moe::String, "Config file to parse"); + testOpts.addOptionChaining("parameter", "parameter", moe::String, "Parameter") + .setSources(moe::SourceAllLegacy); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--parameter"); + argv.push_back("allowed"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.json"); + + parser.setConfig("config.json", "{ parameter : \"disallowed\" }"); + + ASSERT_NOT_OK(parser.run(testOpts, argv, env_map, &environment)); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.ini"); + + parser.setConfig("config.ini", "parameter=allowed"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + } + + TEST(OptionSources, SourceAll) { + OptionsParserTester parser; + moe::Environment environment; + moe::Value value; + std::vector<std::string> argv; + std::map<std::string, std::string> env_map; + std::string parameter; + + moe::OptionSection testOpts; + testOpts.addOptionChaining("config", "config", moe::String, "Config file to parse"); + testOpts.addOptionChaining("parameter", "parameter", moe::String, "Parameter") + .setSources(moe::SourceAll); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--parameter"); + argv.push_back("allowed"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.json"); + + parser.setConfig("config.json", "{ parameter : \"allowed\" }"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + + argv.clear(); + argv.push_back("binaryname"); + argv.push_back("--config"); + argv.push_back("config.ini"); + + parser.setConfig("config.ini", "parameter=allowed"); + + ASSERT_OK(parser.run(testOpts, argv, env_map, &environment)); + ASSERT_OK(environment.get(moe::Key("parameter"), &value)); + ASSERT_OK(value.get(¶meter)); + ASSERT_EQUALS(parameter, "allowed"); + } } // unnamed namespace |