File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 6
6
#include " config/bitcoin-config.h"
7
7
#endif
8
8
9
+ #include " util.h"
9
10
#include " uritests.h"
10
11
11
12
#ifdef ENABLE_WALLET
@@ -27,6 +28,7 @@ Q_IMPORT_PLUGIN(qkrcodecs)
27
28
// This is all you need to run all the tests
28
29
int main (int argc, char *argv[])
29
30
{
31
+ SetupEnvironment ();
30
32
bool fInvalid = false ;
31
33
32
34
// Don't remove this, it's needed to access
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ extern void noui_connect();
28
28
29
29
BasicTestingSetup::BasicTestingSetup ()
30
30
{
31
+ SetupEnvironment ();
31
32
fPrintToDebugLog = false ; // don't want to write to debug.log file
32
33
SelectParams (CBaseChainParams::MAIN);
33
34
}
Original file line number Diff line number Diff line change @@ -723,18 +723,19 @@ void RenameThread(const char* name)
723
723
724
724
void SetupEnvironment ()
725
725
{
726
+ std::locale loc (" C" );
726
727
// On most POSIX systems (e.g. Linux, but not BSD) the environment's locale
727
728
// may be invalid, in which case the "C" locale is used as fallback.
728
729
#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
729
730
try {
730
- std::locale (" " ); // Raises a runtime error if current locale is invalid
731
+ loc = std::locale (" " ); // Raises a runtime error if current locale is invalid
731
732
} catch (const std::runtime_error&) {
732
- std::locale::global ( std::locale ( " C " ) );
733
+ setenv ( " LC_ALL " , " C " , 1 );
733
734
}
734
735
#endif
735
736
// The path locale is lazy initialized and to avoid deinitialization errors
736
737
// in multithreading environments, it is set explicitly by the main thread.
737
- boost::filesystem::path::imbue (std::locale ());
738
+ boost::filesystem::path::imbue (loc);
738
739
}
739
740
740
741
void SetThreadPriority (int nPriority)
You can’t perform that action at this time.
0 commit comments