codex
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1#ifndef CODEX_TEST_COMMON_H
2#define CODEX_TEST_COMMON_H
3
4#include <string>
5#include <string_view>
6
7#include <QTest>
8
9namespace std {
10
14char *toString(string_view s) {
15 return QTest::toString(
16 QString::fromUtf8(s.data(),
17 static_cast<int>(s.size())));
18}
19
23char *toString(string s)
24 { return toString(static_cast<std::string_view>(s)); }
25
26}
27
28#endif
Definition common.hpp:9
char * toString(string_view s)
Adaptor function to display string_view values in test assertion messages.
Definition common.hpp:14
constexpr const char * data(void) const
Definition utils.hpp:18
constexpr std::size_t size(void) const
Definition utils.hpp:17
constexpr fixed_string s
Definition test.cpp:6