diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-11-15 10:45:14 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-11-15 10:45:14 +0000 |
commit | f493eabba7ab361e82868ad16c742cbee9e7fd3f (patch) | |
tree | 35dd6f85e5830b163aa8657a972f9d180bcc5510 /tests | |
parent | Merge pull request #2773 (diff) | |
download | monero-f493eabba7ab361e82868ad16c742cbee9e7fd3f.tar.xz |
unit_tests: fix running without --data-dir
While there, also use the new is_arg_defaulted API instead of
going to poke the internal API directly.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit_tests/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit_tests/main.cpp b/tests/unit_tests/main.cpp index 86e7bcef3..95ea67410 100644 --- a/tests/unit_tests/main.cpp +++ b/tests/unit_tests/main.cpp @@ -52,7 +52,7 @@ int main(int argc, char** argv) ::testing::InitGoogleTest(&argc, argv); po::options_description desc_options("Command line options"); - const command_line::arg_descriptor<std::string> arg_data_dir = {"data-dir", "Data files directory", "", true}; + const command_line::arg_descriptor<std::string> arg_data_dir = { "data-dir", "Data files directory" }; command_line::add_arg(desc_options, arg_data_dir, ""); po::variables_map vm; @@ -65,7 +65,7 @@ int main(int argc, char** argv) if (! r) return 1; - if (vm["data-dir"].defaulted()) + if (command_line::is_arg_defaulted(vm, arg_data_dir)) unit_test::data_dir = boost::filesystem::canonical(boost::filesystem::path(epee::string_tools::get_current_module_folder())) .parent_path().parent_path().parent_path().parent_path() .append("tests").append("data"); |