2
0
mirror of https://github.com/boostorg/nowide.git synced 2026-01-25 06:22:11 +00:00

Include 'Fix update of standalone branch

Use regular rm because  ignores untracked files'
This commit is contained in:
Flamefire
2021-12-21 14:46:45 +00:00
parent 02f40f0b5f
commit fccb720589
54 changed files with 4393 additions and 1980 deletions

View File

@@ -8,11 +8,10 @@
//
#include <nowide/stackstring.hpp>
#include <iostream>
#include <vector>
#include "test.hpp"
#include "test_sets.hpp"
#include <iostream>
#include <vector>
#if defined(NOWIDE_MSVC) && NOWIDE_MSVC < 1700
#pragma warning(disable : 4428) // universal-character-name encountered in source
@@ -22,7 +21,7 @@ template<typename CharOut, typename CharIn, size_t BufferSize>
class test_basic_stackstring : public nowide::basic_stackstring<CharOut, CharIn, BufferSize>
{
public:
typedef nowide::basic_stackstring<CharOut, CharIn, BufferSize> parent;
using parent = nowide::basic_stackstring<CharOut, CharIn, BufferSize>;
using parent::parent;
using parent::uses_stack_memory;
@@ -32,8 +31,8 @@ public:
}
};
typedef test_basic_stackstring<wchar_t, char, 256> test_wstackstring;
typedef test_basic_stackstring<char, wchar_t, 256> test_stackstring;
using test_wstackstring = test_basic_stackstring<wchar_t, char, 256>;
using test_stackstring = test_basic_stackstring<char, wchar_t, 256>;
std::wstring stackstring_to_wide(const std::string& s)
{
@@ -63,6 +62,7 @@ std::string heap_stackstring_to_narrow(const std::wstring& s)
return ss.get();
}
// coverity [root_function]
void test_main(int, char**, char**)
{
std::string hello = "\xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d";
@@ -150,7 +150,7 @@ void test_main(int, char**, char**)
TEST(sw.get() == hello);
}
{
typedef test_basic_stackstring<wchar_t, char, 6> stackstring;
using stackstring = test_basic_stackstring<wchar_t, char, 6>;
const std::wstring heapVal = L"heapValue";
const std::wstring stackVal = L"stack";
const stackstring heap(nowide::narrow(heapVal).c_str());
@@ -230,7 +230,7 @@ void test_main(int, char**, char**)
{
std::cout << "-- Test putting stackstrings into vector (done by args) class" << std::endl;
// Use a smallish buffer, to have stack and heap values
typedef nowide::basic_stackstring<wchar_t, char, 5> stackstring;
using stackstring = nowide::basic_stackstring<wchar_t, char, 5>;
std::vector<stackstring> strings;
strings.resize(2);
TEST(strings[0].convert("1234") == std::wstring(L"1234"));