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:
authorCampbell Barton <ideasman42@gmail.com>2020-12-10 06:25:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-12-10 06:55:28 +0300
commit51cbd5d91d426ecf987585e49585e09db7cb2bc9 (patch)
tree4f3c67683ee9e53654615b375c0604d3bf3a3dfd /source/blender/blenlib
parent564ef8279b5f7b25a4a5f23877c70135c1ec920a (diff)
Cleanup: avoid '_ln' suffix
Use '_len' or '_line_number'.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/tests/BLI_string_test.cc108
1 files changed, 54 insertions, 54 deletions
diff --git a/source/blender/blenlib/tests/BLI_string_test.cc b/source/blender/blenlib/tests/BLI_string_test.cc
index 4446639322c..88cecaa5fee 100644
--- a/source/blender/blenlib/tests/BLI_string_test.cc
+++ b/source/blender/blenlib/tests/BLI_string_test.cc
@@ -27,14 +27,14 @@ TEST(string, StrPartition)
{
const char delim[] = {'-', '.', '_', '~', '\\', '\0'};
const char *sep, *suf;
- size_t pre_ln;
+ size_t pre_len;
{
const char *str = "mat.e-r_ial";
/* "mat.e-r_ial" -> "mat", '.', "e-r_ial", 3 */
- pre_ln = BLI_str_partition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 3);
+ pre_len = BLI_str_partition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 3);
EXPECT_EQ(&str[3], sep);
EXPECT_STREQ("e-r_ial", suf);
}
@@ -44,8 +44,8 @@ TEST(string, StrPartition)
const char *str = ".mate-rial--";
/* ".mate-rial--" -> "", '.', "mate-rial--", 0 */
- pre_ln = BLI_str_partition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_partition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(&str[0], sep);
EXPECT_STREQ("mate-rial--", suf);
}
@@ -54,8 +54,8 @@ TEST(string, StrPartition)
const char *str = ".__.--_";
/* ".__.--_" -> "", '.', "__.--_", 0 */
- pre_ln = BLI_str_partition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_partition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(&str[0], sep);
EXPECT_STREQ("__.--_", suf);
}
@@ -64,8 +64,8 @@ TEST(string, StrPartition)
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
- pre_ln = BLI_str_partition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_partition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -74,8 +74,8 @@ TEST(string, StrPartition)
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
- pre_ln = BLI_str_partition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 8);
+ pre_len = BLI_str_partition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -86,14 +86,14 @@ TEST(string, StrRPartition)
{
const char delim[] = {'-', '.', '_', '~', '\\', '\0'};
const char *sep, *suf;
- size_t pre_ln;
+ size_t pre_len;
{
const char *str = "mat.e-r_ial";
/* "mat.e-r_ial" -> "mat.e-r", '_', "ial", 7 */
- pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 7);
+ pre_len = BLI_str_rpartition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 7);
EXPECT_EQ(&str[7], sep);
EXPECT_STREQ("ial", suf);
}
@@ -103,8 +103,8 @@ TEST(string, StrRPartition)
const char *str = ".mate-rial--";
/* ".mate-rial--" -> ".mate-rial-", '-', "", 11 */
- pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 11);
+ pre_len = BLI_str_rpartition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 11);
EXPECT_EQ(&str[11], sep);
EXPECT_STREQ("", suf);
}
@@ -113,8 +113,8 @@ TEST(string, StrRPartition)
const char *str = ".__.--_";
/* ".__.--_" -> ".__.--", '_', "", 6 */
- pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 6);
+ pre_len = BLI_str_rpartition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 6);
EXPECT_EQ(&str[6], sep);
EXPECT_STREQ("", suf);
}
@@ -123,8 +123,8 @@ TEST(string, StrRPartition)
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
- pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_rpartition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -133,8 +133,8 @@ TEST(string, StrRPartition)
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
- pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 8);
+ pre_len = BLI_str_rpartition(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -145,7 +145,7 @@ TEST(string, StrPartitionEx)
{
const char delim[] = {'-', '.', '_', '~', '\\', '\0'};
const char *sep, *suf;
- size_t pre_ln;
+ size_t pre_len;
/* Only considering 'from_right' cases here. */
@@ -153,8 +153,8 @@ TEST(string, StrPartitionEx)
const char *str = "mat.e-r_ia.l";
/* "mat.e-r_ia.l" over "mat.e-r" -> "mat.e", '.', "r_ia.l", 3 */
- pre_ln = BLI_str_partition_ex(str, str + 6, delim, &sep, &suf, true);
- EXPECT_EQ(pre_ln, 5);
+ pre_len = BLI_str_partition_ex(str, str + 6, delim, &sep, &suf, true);
+ EXPECT_EQ(pre_len, 5);
EXPECT_EQ(&str[5], sep);
EXPECT_STREQ("r_ia.l", suf);
}
@@ -164,8 +164,8 @@ TEST(string, StrPartitionEx)
const char *str = "mate.rial";
/* "mate.rial" over "mate" -> "mate.rial", NULL, NULL, 4 */
- pre_ln = BLI_str_partition_ex(str, str + 4, delim, &sep, &suf, true);
- EXPECT_EQ(pre_ln, 4);
+ pre_len = BLI_str_partition_ex(str, str + 4, delim, &sep, &suf, true);
+ EXPECT_EQ(pre_len, 4);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -176,14 +176,14 @@ TEST(string, StrPartitionUtf8)
{
const unsigned int delim[] = {'-', '.', '_', 0x00F1 /* n tilde */, 0x262F /* ying-yang */, '\0'};
const char *sep, *suf;
- size_t pre_ln;
+ size_t pre_len;
{
const char *str = "ma\xc3\xb1te-r\xe2\x98\xafial";
/* "ma\xc3\xb1te-r\xe2\x98\xafial" -> "ma", '\xc3\xb1', "te-r\xe2\x98\xafial", 2 */
- pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 2);
+ pre_len = BLI_str_partition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 2);
EXPECT_EQ(&str[2], sep);
EXPECT_STREQ("te-r\xe2\x98\xafial", suf);
}
@@ -193,8 +193,8 @@ TEST(string, StrPartitionUtf8)
const char *str = "\xe2\x98\xafmate-rial-\xc3\xb1";
/* "\xe2\x98\xafmate-rial-\xc3\xb1" -> "", '\xe2\x98\xaf', "mate-rial-\xc3\xb1", 0 */
- pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_partition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(&str[0], sep);
EXPECT_STREQ("mate-rial-\xc3\xb1", suf);
}
@@ -203,8 +203,8 @@ TEST(string, StrPartitionUtf8)
const char *str = "\xe2\x98\xaf.\xc3\xb1_.--\xc3\xb1";
/* "\xe2\x98\xaf.\xc3\xb1_.--\xc3\xb1" -> "", '\xe2\x98\xaf', ".\xc3\xb1_.--\xc3\xb1", 0 */
- pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_partition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(&str[0], sep);
EXPECT_STREQ(".\xc3\xb1_.--\xc3\xb1", suf);
}
@@ -213,8 +213,8 @@ TEST(string, StrPartitionUtf8)
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
- pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_partition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -223,8 +223,8 @@ TEST(string, StrPartitionUtf8)
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
- pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 8);
+ pre_len = BLI_str_partition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -235,14 +235,14 @@ TEST(string, StrRPartitionUtf8)
{
const unsigned int delim[] = {'-', '.', '_', 0x00F1 /* n tilde */, 0x262F /* ying-yang */, '\0'};
const char *sep, *suf;
- size_t pre_ln;
+ size_t pre_len;
{
const char *str = "ma\xc3\xb1te-r\xe2\x98\xafial";
/* "ma\xc3\xb1te-r\xe2\x98\xafial" -> "mat\xc3\xb1te-r", '\xe2\x98\xaf', "ial", 8 */
- pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 8);
+ pre_len = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 8);
EXPECT_EQ(&str[8], sep);
EXPECT_STREQ("ial", suf);
}
@@ -252,8 +252,8 @@ TEST(string, StrRPartitionUtf8)
const char *str = "\xe2\x98\xafmate-rial-\xc3\xb1";
/* "\xe2\x98\xafmate-rial-\xc3\xb1" -> "\xe2\x98\xafmate-rial-", '\xc3\xb1', "", 13 */
- pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 13);
+ pre_len = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 13);
EXPECT_EQ(&str[13], sep);
EXPECT_STREQ("", suf);
}
@@ -262,8 +262,8 @@ TEST(string, StrRPartitionUtf8)
const char *str = "\xe2\x98\xaf.\xc3\xb1_.--\xc3\xb1";
/* "\xe2\x98\xaf.\xc3\xb1_.--\xc3\xb1" -> "\xe2\x98\xaf.\xc3\xb1_.--", '\xc3\xb1', "", 10 */
- pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 10);
+ pre_len = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 10);
EXPECT_EQ(&str[10], sep);
EXPECT_STREQ("", suf);
}
@@ -272,8 +272,8 @@ TEST(string, StrRPartitionUtf8)
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
- pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 0);
+ pre_len = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -282,8 +282,8 @@ TEST(string, StrRPartitionUtf8)
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
- pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
- EXPECT_EQ(pre_ln, 8);
+ pre_len = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
+ EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
@@ -294,7 +294,7 @@ TEST(string, StrPartitionExUtf8)
{
const unsigned int delim[] = {'-', '.', '_', 0x00F1 /* n tilde */, 0x262F /* ying-yang */, '\0'};
const char *sep, *suf;
- size_t pre_ln;
+ size_t pre_len;
/* Only considering 'from_right' cases here. */
@@ -303,8 +303,8 @@ TEST(string, StrPartitionExUtf8)
/* "ma\xc3\xb1te-r\xe2\x98\xafial" over
* "ma\xc3\xb1te" -> "ma", '\xc3\xb1', "te-r\xe2\x98\xafial", 2 */
- pre_ln = BLI_str_partition_ex_utf8(str, str + 6, delim, &sep, &suf, true);
- EXPECT_EQ(pre_ln, 2);
+ pre_len = BLI_str_partition_ex_utf8(str, str + 6, delim, &sep, &suf, true);
+ EXPECT_EQ(pre_len, 2);
EXPECT_EQ(&str[2], sep);
EXPECT_STREQ("te-r\xe2\x98\xafial", suf);
}
@@ -314,8 +314,8 @@ TEST(string, StrPartitionExUtf8)
const char *str = "mate\xe2\x98\xafrial";
/* "mate\xe2\x98\xafrial" over "mate" -> "mate\xe2\x98\xafrial", NULL, NULL, 4 */
- pre_ln = BLI_str_partition_ex_utf8(str, str + 4, delim, &sep, &suf, true);
- EXPECT_EQ(pre_ln, 4);
+ pre_len = BLI_str_partition_ex_utf8(str, str + 4, delim, &sep, &suf, true);
+ EXPECT_EQ(pre_len, 4);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}