-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency on Boost's UUID and Lexical Cast libraries
- Loading branch information
Showing
4 changed files
with
61 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* LOOT | ||
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and | ||
Fallout: New Vegas. | ||
Copyright (C) 2014-2016 WrinklyNinja | ||
This file is part of LOOT. | ||
LOOT is free software: you can redistribute | ||
it and/or modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation, either version 3 of | ||
the License, or (at your option) any later version. | ||
LOOT is distributed in the hope that it will | ||
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with LOOT. If not, see | ||
<https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef LOOT_TESTS_TEST_HELPERS | ||
#define LOOT_TESTS_TEST_HELPERS | ||
|
||
#include <filesystem> | ||
#include <random> | ||
#include <string> | ||
|
||
namespace loot::test { | ||
std::filesystem::path getRootTestPath() { | ||
std::random_device randomDevice; | ||
std::default_random_engine prng(randomDevice()); | ||
std::uniform_int_distribution dist(0x61, | ||
0x7A); // values of a-z in ASCII/UTF-8. | ||
|
||
// The non-ASCII character is there to ensure test coverage of non-ASCII path | ||
// handling. | ||
std::string directoryName = u8"libloot-t\u00E9st-"; | ||
|
||
for (int i = 0; i < 16; i += 1) { | ||
directoryName.push_back(static_cast<char>(dist(prng))); | ||
} | ||
|
||
return std::filesystem::absolute(std::filesystem::temp_directory_path() / | ||
std::filesystem::u8path(directoryName)); | ||
} | ||
} | ||
|
||
#endif |