MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/argsman_tests.cpp:27–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25BOOST_FIXTURE_TEST_SUITE(argsman_tests, BasicTestingSetup)
26
27BOOST_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
52struct TestArgsManager : public ArgsManager
53{

Callers

nothing calls this directly

Calls 15

PathToStringFunction · 0.85
ChainTypeToStringFunction · 0.85
ForceSetArgMethod · 0.80
GetDataDirBaseMethod · 0.80
ClearPathCacheMethod · 0.80
SetupArgsMethod · 0.80
ParseParametersMethod · 0.80
IsArgSetMethod · 0.80
GetArgsMethod · 0.80
IsArgNegatedMethod · 0.80
GetBoolArgMethod · 0.80
GetArgMethod · 0.80

Tested by

no test coverage detected