Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/tests/BLI_string_test.cc')
-rw-r--r--source/blender/blenlib/tests/BLI_string_test.cc23
1 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/blenlib/tests/BLI_string_test.cc b/source/blender/blenlib/tests/BLI_string_test.cc
index 88cecaa5fee..0b68ee8b93c 100644
--- a/source/blender/blenlib/tests/BLI_string_test.cc
+++ b/source/blender/blenlib/tests/BLI_string_test.cc
@@ -421,9 +421,7 @@ TEST(string, StrFormatByteUnits)
}
struct WordInfo {
- WordInfo()
- {
- }
+ WordInfo() = default;
WordInfo(int start, int end) : start(start), end(end)
{
}
@@ -441,9 +439,7 @@ static std::ostream &operator<<(std::ostream &os, const WordInfo &word_info)
class StringFindSplitWords : public testing::Test {
protected:
- StringFindSplitWords()
- {
- }
+ StringFindSplitWords() = default;
/* If max_words is -1 it will be initialized from the number of expected
* words +1. This way there is no need to pass an explicit number of words,
@@ -807,9 +803,7 @@ TEST_F(StringCasecmpNatural, TextAndNumbers)
class StringEscape : public testing::Test {
protected:
- StringEscape()
- {
- }
+ StringEscape() = default;
using CompareWordsArray = vector<std::array<const char *, 2>>;
@@ -832,6 +826,9 @@ class StringEscape : public testing::Test {
TEST_F(StringEscape, Simple)
{
+ /* NOTE: clang-tidy `modernize-raw-string-literal` is disabled as it causes errors with MSVC.
+ * TODO: investigate resolving with `/Zc:preprocessor` flag. */
+
const CompareWordsArray equal{
{"", ""},
{"/", "/"},
@@ -845,11 +842,16 @@ TEST_F(StringEscape, Simple)
{"\\A", "\\\\A"},
{"A\\B", "A\\\\B"},
{"?", "?"},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\"\\", "\\\"\\\\"},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\\\"", "\\\\\\\""},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\"\\\"", "\\\"\\\\\\\""},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\"\"\"", "\\\"\\\"\\\""},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\\\\\\", "\\\\\\\\\\\\"},
};
@@ -868,8 +870,11 @@ TEST_F(StringEscape, Control)
{"\f", "\\f"},
{"A\n", "A\\n"},
{"\nA", "\\nA"},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\n\r\t\a\b\f", "\\n\\r\\t\\a\\b\\f"},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\n_\r_\t_\a_\b_\f", "\\n_\\r_\\t_\\a_\\b_\\f"},
+ /* NOLINTNEXTLINE: modernize-raw-string-literal. */
{"\n\\\r\\\t\\\a\\\b\\\f", "\\n\\\\\\r\\\\\\t\\\\\\a\\\\\\b\\\\\\f"},
};