Skip to content

Commit 0828f31

Browse files
authored
fix(test/string): fix gcc 16 build issue (#3137)
* fix(test/string): avoid use of deleted function Remove portion of code to fix a build issue for gcc16(C++23), where the build fails due to test `error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const wchar_t*) [with _Traits = char_traits<char>]’ 148 | DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), L"");` * fix(test/tokenizer): remove u8"..." C++20 fails due to convert from ‘<brace-enclosed initializer list>’ to ‘std::vector<std::__cxx11::basic_string<char> >’ * Revert "fix(test/string): avoid use of deleted function" This reverts commit ad56f13. * fix(test/string): Attempt fix again without deleting the test
1 parent 8f29efb commit 0828f31

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

dlib/test/string.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ namespace
145145

146146
wstring ws = L"file.txt";
147147
DLIB_TEST( (left_substr(ws,wstring(L".")) == L"file"));
148-
DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), L"");
148+
DLIB_TEST_MSG( (left_substr(ws,L".") == L"file"), "");
149149
DLIB_TEST( (right_substr(ws,wstring(L".")) == L"txt"));
150-
DLIB_TEST_MSG( (right_substr(ws,L".") == L"txt"), L"");
150+
DLIB_TEST_MSG( (right_substr(ws,L".") == L"txt"), "");
151151

152152

153153
dlog << LTRACE << 8;

dlib/test/tokenizer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ namespace
394394
deserialize(loaded_test, in_stream);
395395

396396
std::vector<std::string> test_strings = {
397-
u8"This is a test of the tokenisation process...\nimplemented in the Dlib library!", // English
398-
u8"Ceci est un test du processus de\ntokenisation implémenté dans\nla bibliothèque Dlib!", // French
399-
u8"Dette er en test af tokeniseringsprocessen implementeret i Dlib-biblioteket!", // Danish
400-
u8"这是对Dlib库中实现的标记化过程的测试!" // Chinese
397+
"This is a test of the tokenisation process...\nimplemented in the Dlib library!", // English
398+
"Ceci est un test du processus de\ntokenisation implémenté dans\nla bibliothèque Dlib!", // French
399+
"Dette er en test af tokeniseringsprocessen implementeret i Dlib-biblioteket!", // Danish
400+
"这是对Dlib库中实现的标记化过程的测试!" // Chinese
401401
};
402402

403403
for (const auto& text : test_strings) {

0 commit comments

Comments
 (0)