| 25 | BOOST_FIXTURE_TEST_SUITE(argsman_tests, BasicTestingSetup) |
| 26 | |
| 27 | BOOST_AUTO_TEST_CASE(util_datadir) |
| 28 | { |
| 29 | // Use local args variable instead of m_args to avoid making assumptions about test setup |
| 30 | ArgsManager args; |
| 31 | args.ForceSetArg("-datadir", fs::PathToString(m_path_root)); |
| 32 | |
| 33 | const fs::path dd_norm = args.GetDataDirBase(); |
| 34 | |
| 35 | args.ForceSetArg("-datadir", fs::PathToString(dd_norm) + "/"); |
| 36 | args.ClearPathCache(); |
| 37 | BOOST_CHECK_EQUAL(dd_norm, args.GetDataDirBase()); |
| 38 | |
| 39 | args.ForceSetArg("-datadir", fs::PathToString(dd_norm) + "/."); |
| 40 | args.ClearPathCache(); |
| 41 | BOOST_CHECK_EQUAL(dd_norm, args.GetDataDirBase()); |
| 42 | |
| 43 | args.ForceSetArg("-datadir", fs::PathToString(dd_norm) + "/./"); |
| 44 | args.ClearPathCache(); |
| 45 | BOOST_CHECK_EQUAL(dd_norm, args.GetDataDirBase()); |
| 46 | |
| 47 | args.ForceSetArg("-datadir", fs::PathToString(dd_norm) + "/.//"); |
| 48 | args.ClearPathCache(); |
| 49 | BOOST_CHECK_EQUAL(dd_norm, args.GetDataDirBase()); |
| 50 | } |
| 51 | |
| 52 | struct TestArgsManager : public ArgsManager |
| 53 | { |
nothing calls this directly
no test coverage detected