@@ -49,24 +49,27 @@ BOOST_FIXTURE_TEST_SUITE(util_tests, BasicTestingSetup)
49
49
50
50
BOOST_AUTO_TEST_CASE(util_datadir)
51
51
{
52
- ClearDatadirCache ();
53
- const fs::path dd_norm = GetDataDir ();
52
+ // Use local args variable instead of m_args to avoid making assumptions about test setup
53
+ ArgsManager args;
54
+ args.ForceSetArg (" -datadir" , m_path_root.string ());
55
+
56
+ const fs::path dd_norm = args.GetDataDirPath ();
54
57
55
- gArgs .ForceSetArg (" -datadir" , dd_norm.string () + " /" );
58
+ args .ForceSetArg (" -datadir" , dd_norm.string () + " /" );
56
59
ClearDatadirCache ();
57
- BOOST_CHECK_EQUAL (dd_norm, GetDataDir ());
60
+ BOOST_CHECK_EQUAL (dd_norm, args. GetDataDirPath ());
58
61
59
- gArgs .ForceSetArg (" -datadir" , dd_norm.string () + " /." );
62
+ args .ForceSetArg (" -datadir" , dd_norm.string () + " /." );
60
63
ClearDatadirCache ();
61
- BOOST_CHECK_EQUAL (dd_norm, GetDataDir ());
64
+ BOOST_CHECK_EQUAL (dd_norm, args. GetDataDirPath ());
62
65
63
- gArgs .ForceSetArg (" -datadir" , dd_norm.string () + " /./" );
66
+ args .ForceSetArg (" -datadir" , dd_norm.string () + " /./" );
64
67
ClearDatadirCache ();
65
- BOOST_CHECK_EQUAL (dd_norm, GetDataDir ());
68
+ BOOST_CHECK_EQUAL (dd_norm, args. GetDataDirPath ());
66
69
67
- gArgs .ForceSetArg (" -datadir" , dd_norm.string () + " /.//" );
70
+ args .ForceSetArg (" -datadir" , dd_norm.string () + " /.//" );
68
71
ClearDatadirCache ();
69
- BOOST_CHECK_EQUAL (dd_norm, GetDataDir ());
72
+ BOOST_CHECK_EQUAL (dd_norm, args. GetDataDirPath ());
70
73
}
71
74
72
75
BOOST_AUTO_TEST_CASE (util_check)
0 commit comments