Blender V5.3
BLI_path_utils_test.cc File Reference
#include "testing/testing.h"
#include "IMB_imbuf.hh"
#include "BLI_fileops.hh"
#include "BLI_path_utils.hh"
#include "BLI_string.hh"
#include "BLI_string_utils.hh"

Go to the source code of this file.

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define DO_PERF_TESTS   0

Functions

Tests for: #BLI_path_cmp_normalized
Note
BLI_path_normalize tests handle most of the corner cases.
 blender::TEST (path_utils, CompareNormalized)
Tests for: #BLI_path_is_unc
 blender::TEST (path_utils, IsUnc)
Tests for: #BLI_path_is_win32_drive
 blender::TEST (path_utils, IsWin32Drive)
Tests for: #BLI_path_is_win32_drive_only
 blender::TEST (path_utils, IsWin32DriveOnly)
Tests for: #BLI_path_is_win32_drive_with_slash
 blender::TEST (path_utils, IsWin32DriveWithSlash)
Tests for: #BLI_path_frame
 blender::TEST (path_utils, Frame)
Tests for: #BLI_path_split_dir_file
 blender::TEST (path_utils, SplitDirfile)
Tests for: #BLI_path_extension
 blender::TEST (path_utils, Extension)
Tests for: #BLI_path_is_rel
 blender::TEST (path_utils, PathIsRel)
Tests for: #BLI_path_is_abs_from_cwd
 blender::TEST (path_utils, PathIsAbsFromCwd)
Tests for: #BLI_path_contains
 blender::TEST (path_utils, Contains)
Tests for: #BLI_path_relative_to
 blender::TEST (path_utils, RelativeTo)
 blender::TEST (path_utils, RelativeTo_walk_up)
Tests for: #BLI_path_has_hidden_component
 blender::TEST (path_utils, HasHiddenComponents)

Local Utilities

#define ABS_PREFIX   ""
static void blender::str_replace_char_with_relative_exception (char *str, char src, char dst)
static char * blender::str_replace_char_strdup (const char *str, char src, char dst)

Tests for: #BLI_path_normalize

#define NORMALIZE(input, output_expect)
 blender::TEST (path_utils, Normalize_Nop)
 blender::TEST (path_utils, Normalize_NopRelative)
 blender::TEST (path_utils, Normalize_Dot)
 blender::TEST (path_utils, Normalize_ComplexAbsolute)
 blender::TEST (path_utils, Normalize_ComplexRelative)
 blender::TEST (path_utils, Normalize_DoubleSlash)
 blender::TEST (path_utils, Normalize_Parent)
 blender::TEST (path_utils, Normalize_UnbalancedAbsolute)
 blender::TEST (path_utils, Normalize_UnbalancedRelative)
 blender::TEST (path_utils, Normalize_UnbalancedRelativeTrailing)

Tests for: #BLI_path_parent_dir

#define PARENT_DIR(input, output_expect)
 blender::TEST (path_utils, ParentDir_Simple)
 blender::TEST (path_utils, ParentDir_NOP)
 blender::TEST (path_utils, ParentDir_TrailingPeriod)
 blender::TEST (path_utils, ParentDir_Complex)

Tests for: #BLI_path_parent_dir_end

#define PARENT_DIR_END(input, offset_expect)
 blender::TEST (path_utils, ParentDirEnd_Simple)
 blender::TEST (path_utils, ParentDirEnd_Redundant)

Tests for: #BLI_path_name_at_index

#define AT_INDEX(str_input, index_input, str_expect)
#define TEST_STR   "./a/./b/./c/."
#define TEST_STR   ".//a//.//b//.//c//.//"
 blender::TEST (path_utils, NameAtIndex_Single)
 blender::TEST (path_utils, NameAtIndex_SingleNeg)
 blender::TEST (path_utils, NameAtIndex_Double)
 blender::TEST (path_utils, NameAtIndex_DoublNeg)
 blender::TEST (path_utils, NameAtIndex_Misc)
 blender::TEST (path_utils, NameAtIndex_MiscNeg)
 blender::TEST (path_utils, NameAtIndex_SingleDot)
 blender::TEST (path_utils, NameAtIndex_SingleDotNeg)
 blender::TEST (path_utils, NameAtIndex_SingleDotDoubleSlash)
 blender::TEST (path_utils, NameAtIndex_SingleDotDoubleSlashNeg)
 blender::TEST (path_utils, NameAtIndex_SingleDotSeries)
 blender::TEST (path_utils, NameAtIndex_SingleDotSeriesNeg)
 blender::TEST (path_utils, NameAtIndex_MiscComplex)
 blender::TEST (path_utils, NameAtIndex_MiscComplexNeg)
 blender::TEST (path_utils, NameAtIndex_NoneComplex)
 blender::TEST (path_utils, NameAtIndex_NoneComplexNeg)

Tests for: #BLI_path_join

#define JOIN_FORWARD_SLASH(str_expect, out_size, ...)
#define JOIN_BACK_SLASH(str_expect, out_size, ...)
#define JOIN   JOIN_FORWARD_SLASH
 blender::TEST (path_utils, JoinNop)
 blender::TEST (path_utils, JoinSingle)
 blender::TEST (path_utils, JoinTriple)
 blender::TEST (path_utils, JoinTruncateShort)
 blender::TEST (path_utils, JoinTruncateLong)
 blender::TEST (path_utils, JoinComplex)
 blender::TEST (path_utils, JoinRelativePrefix)

Tests for: #BLI_path_append

#define APPEND(str_expect, size, path, filename)
 blender::TEST (path_utils, AppendFile)
 blender::TEST (path_utils, AppendFile_Truncate)

Tests for: #BLI_path_frame_strip

#define PATH_FRAME_STRIP(input_path, expect_path, expect_ext)
 blender::TEST (path_utils, FrameStrip)

Tests for: #BLI_path_extension_check

#define PATH_EXTENSION_CHECK(input_path, input_ext, expect_ext)
 blender::TEST (path_utils, ExtensionCheck)

Tests for: #BLI_path_extension_replace

#define PATH_EXTENSION_REPLACE_WITH_MAXLEN(input_path, input_ext, expect_result, expect_path, maxlen)
#define PATH_EXTENSION_REPLACE(input_path, input_ext, expect_result, expect_path)
 blender::TEST (path_utils, ExtensionReplace)
 blender::TEST (path_utils, ExtensionReplace_Overflow)

Tests for: #BLI_path_extension_ensure

#define PATH_EXTENSION_ENSURE_WITH_MAXLEN(input_path, input_ext, expect_result, expect_path, maxlen)
#define PATH_EXTENSION_ENSURE(input_path, input_ext, expect_result, expect_path)
 blender::TEST (path_utils, ExtensionEnsure)
 blender::TEST (path_utils, ExtensionEnsure_Overflow)

Tests for: #BLI_path_frame_check_chars

#define PATH_FRAME_CHECK_CHARS(input_path, expect_hasChars)
 blender::TEST (path_utils, FrameCheckChars)

Tests for: #BLI_path_frame_range

#define PATH_FRAME_RANGE(input_path, sta, end, digits, expect_outpath)
 blender::TEST (path_utils, FrameRange)

Tests for: #BLI_path_frame_get

#define PATH_FRAME_GET(input_path, expect_frame, expect_numdigits, expect_pathisvalid)
 blender::TEST (path_utils, FrameGet)

Tests for: #BLI_path_sequence_decode

#define PATH_SEQ_DECODE(path_literal, expect_result, expect_head, expect_tail, expect_numdigits)
 blender::TEST (path_utils, SequenceDecode)

Tests for: #BLI_path_suffix

#define PATH_SUFFIX(path_literal, path_literal_max, sep, suffix, expect_result, expect_path)
 blender::TEST (path_utils, Suffix)

Tests for: #BLI_path_slash_find

#define PATH_SLASH_FIND(path, expect_index)
 blender::TEST (path_util, SlashFind)

Tests for: #BLI_path_slash_rfind

#define PATH_SLASH_RFIND(path, expect_index)
 blender::TEST (path_util, SlashRFind)

Tests for: #BLI_path_slash_ensure

#define PATH_SLASH_ENSURE(input, size, output_expect, length_expect)
 blender::TEST (path_util, SlashEnsure)

Tests for: #BLI_path_slash_rstrip

#define PATH_SLASH_RSTRIP(input, expected)
 blender::TEST (path_util, SlashRStrip)

Tests for: #BLI_path_slash_skip

#define PATH_SLASH_SKIP(input, expected)
 blender::TEST (path_util, SlashSkip)

Tests for: #BLI_path_slash_native

#define PATH_SLASH_NATIVE(input, expected)
 blender::TEST (path_util, SlashNative)

Tests for: #BLI_path_rel

#define PATH_REL(abs_path, ref_path, rel_path_expect)
 blender::TEST (path_utils, RelPath_Simple)
 blender::TEST (path_utils, RelPath_SimpleSubdir)
 blender::TEST (path_utils, RelPath_SameDir)
 blender::TEST (path_utils, RelPath_ParentDir)
 blender::TEST (path_utils, RelPath_NoCommonRoot)
 blender::TEST (path_utils, RelPath_BufferOverflowRoot)
 blender::TEST (path_utils, RelPath_BufferOverflowSubdir)

Tests for: #BLI_path_abs

#define PATH_ABS(rel_path, base_path, abs_path_expect, result_expect)
 blender::TEST (path_utils, AbsPath_Simple)
 blender::TEST (path_utils, AbsPath_BaseDir)
 blender::TEST (path_utils, AbsPath_PrefixOnly)
 blender::TEST (path_utils, AbsPath_ParentDir)
 blender::TEST (path_utils, AbsPath_BackSlash)
 blender::TEST (path_utils, AbsPath_NotRelative)
 blender::TEST (path_utils, AbsPath_Win32DriveOnPosix)
 blender::TEST (path_utils, AbsPath_ExtraSlashes)
 blender::TEST (path_utils, AbsPath_NoBaseDir)
 blender::TEST (path_utils, AbsPath_NoBaseDirExtraSlashes)
 blender::TEST (path_utils, AbsPath_BufferOverflow)

Macro Definition Documentation

◆ ABS_PREFIX

◆ APPEND

#define APPEND ( str_expect,
size,
path,
filename )
Value:
{ \
const char *expect = str_expect; \
char result[(size) + 1024] = path; \
char filename_native[] = filename; \
\
if (SEP == '\\') { \
BLI_string_replace_char(filename_native, '/', '\\'); \
BLI_string_replace_char(result, '/', '\\'); \
} \
BLI_path_append(result, size, filename_native); \
if (SEP == '\\') { \
BLI_string_replace_char(result, '\\', '/'); \
} \
EXPECT_STREQ(result, expect); \
} \
((void)0)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52

Definition at line 778 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), and blender::TEST().

◆ AT_INDEX

#define AT_INDEX ( str_input,
index_input,
str_expect )
Value:
{ \
char path[] = str_input; \
\
if (SEP == '\\') { \
BLI_string_replace_char(path, '/', '\\'); \
} \
const char *expect = str_expect; \
int index_output, len_output; \
const bool ret = BLI_path_name_at_index(path, index_input, &index_output, &len_output); \
if (expect == nullptr) { \
EXPECT_FALSE(ret); \
} \
else { \
EXPECT_TRUE(ret); \
EXPECT_EQ(len_output, strlen(expect)); \
path[index_output + len_output] = '\0'; \
EXPECT_STREQ(&path[index_output], expect); \
} \
} \
((void)0)

Definition at line 303 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), and blender::TEST().

◆ DO_PERF_TESTS

#define DO_PERF_TESTS   0

Definition at line 16 of file BLI_path_utils_test.cc.

◆ JOIN

◆ JOIN_BACK_SLASH

#define JOIN_BACK_SLASH ( str_expect,
out_size,
... )
Value:
{ \
const char *expect = str_expect; \
char result[(out_size) + 1024]; \
const char *input_forward_slash[] = {__VA_ARGS__}; \
char *input_back_slash[ARRAY_SIZE(input_forward_slash)] = {nullptr}; \
for (int i = 0; i < ARRAY_SIZE(input_forward_slash); i++) { \
input_back_slash[i] = strdup(input_forward_slash[i]); \
BLI_string_replace_char(input_back_slash[i], '/', '\\'); \
} \
\
result[out_size] = '\0'; \
BLI_path_join_array(result, \
out_size, \
const_cast<const char **>(input_back_slash), \
ARRAY_SIZE(input_back_slash)); \
BLI_string_replace_char(result, '\\', '/'); \
EXPECT_STREQ(result, expect); \
EXPECT_EQ(result[out_size], '\0'); \
for (int i = 0; i < ARRAY_SIZE(input_forward_slash); i++) { \
free(input_back_slash[i]); \
} \
} \
((void)0)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept

Definition at line 647 of file BLI_path_utils_test.cc.

◆ JOIN_FORWARD_SLASH

#define JOIN_FORWARD_SLASH ( str_expect,
out_size,
... )
Value:
{ \
const char *expect = str_expect; \
char result[(out_size) + 1024]; \
\
result[out_size] = '\0'; \
BLI_path_join(result, out_size, __VA_ARGS__); \
EXPECT_STREQ(result, expect); \
EXPECT_EQ(result[out_size], '\0'); \
} \
((void)0)

Definition at line 632 of file BLI_path_utils_test.cc.

◆ NORMALIZE

#define NORMALIZE ( input,
output_expect )
Value:
{ \
char path[FILE_MAX] = input; \
if (SEP == '\\') { \
str_replace_char_with_relative_exception(path, '/', '\\'); \
} \
const int path_len_test = BLI_path_normalize(path); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '\\', '/'); \
} \
EXPECT_STREQ(path, output_expect); \
EXPECT_EQ(path_len_test, strlen(path)); \
} \
((void)0)
#define FILE_MAX

Definition at line 58 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), and blender::TEST().

◆ PARENT_DIR

#define PARENT_DIR ( input,
output_expect )
Value:
{ \
char path[FILE_MAX] = input; \
if (SEP == '\\') { \
BLI_string_replace_char(path, '/', '\\'); \
} \
BLI_path_parent_dir(path); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '\\', '/'); \
} \
EXPECT_STREQ(path, output_expect); \
} \
((void)0)

Definition at line 200 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), blender::TEST(), blender::TEST(), and blender::TEST().

◆ PARENT_DIR_END

#define PARENT_DIR_END ( input,
offset_expect )
Value:
{ \
const char *path = input; \
const char *path_end = BLI_path_parent_dir_end(path, strlen(path)); \
EXPECT_EQ(path_end ? int(path_end - path) : -1, offset_expect) << "path: " << path; \
} \
((void)0)

Definition at line 268 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), and blender::TEST().

◆ PATH_ABS

#define PATH_ABS ( rel_path,
base_path,
abs_path_expect,
result_expect )
Value:
{ \
char path[FILE_MAX]; \
const char *base_path_test = base_path; \
STRNCPY(path, rel_path); \
if (SEP == '\\') { \
base_path_test = str_replace_char_strdup(base_path_test, '/', '\\'); \
} \
const bool result_test = BLI_path_abs(path, base_path_test); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '\\', '/'); \
free((void *)base_path_test); \
} \
EXPECT_STREQ(path, abs_path_expect); \
EXPECT_EQ(result_test, result_expect); \
} \
void(0)

Definition at line 1756 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), and blender::TEST().

◆ PATH_EXTENSION_CHECK

#define PATH_EXTENSION_CHECK ( input_path,
input_ext,
expect_ext )
Value:
{ \
const bool ret = BLI_path_extension_check(input_path, input_ext); \
if (STREQ(input_ext, expect_ext)) { \
EXPECT_TRUE(ret); \
} \
else { \
EXPECT_FALSE(ret); \
} \
} \
((void)0)
#define STREQ(a, b)

Definition at line 1045 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_EXTENSION_ENSURE

#define PATH_EXTENSION_ENSURE ( input_path,
input_ext,
expect_result,
expect_path )
Value:
PATH_EXTENSION_ENSURE_WITH_MAXLEN(input_path, input_ext, expect_result, expect_path, FILE_MAX)
#define PATH_EXTENSION_ENSURE_WITH_MAXLEN(input_path, input_ext, expect_result, expect_path, maxlen)

Definition at line 1176 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_EXTENSION_ENSURE_WITH_MAXLEN

#define PATH_EXTENSION_ENSURE_WITH_MAXLEN ( input_path,
input_ext,
expect_result,
expect_path,
maxlen )
Value:
{ \
BLI_assert(maxlen <= FILE_MAX); \
char path[FILE_MAX]; \
STRNCPY(path, input_path); \
const bool ret = BLI_path_extension_ensure(path, maxlen, input_ext); \
if (expect_result) { \
EXPECT_TRUE(ret); \
} \
else { \
EXPECT_FALSE(ret); \
} \
EXPECT_STREQ(path, expect_path); \
} \
((void)0)

Definition at line 1159 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_EXTENSION_REPLACE

#define PATH_EXTENSION_REPLACE ( input_path,
input_ext,
expect_result,
expect_path )
Value:
PATH_EXTENSION_REPLACE_WITH_MAXLEN(input_path, input_ext, expect_result, expect_path, FILE_MAX)
#define PATH_EXTENSION_REPLACE_WITH_MAXLEN(input_path, input_ext, expect_result, expect_path, maxlen)

Definition at line 1105 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_EXTENSION_REPLACE_WITH_MAXLEN

#define PATH_EXTENSION_REPLACE_WITH_MAXLEN ( input_path,
input_ext,
expect_result,
expect_path,
maxlen )
Value:
{ \
BLI_assert(maxlen <= FILE_MAX); \
char path[FILE_MAX]; \
STRNCPY(path, input_path); \
const bool ret = BLI_path_extension_replace(path, maxlen, input_ext); \
if (expect_result) { \
EXPECT_TRUE(ret); \
} \
else { \
EXPECT_FALSE(ret); \
} \
EXPECT_STREQ(path, expect_path); \
} \
((void)0)

Definition at line 1088 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_FRAME_CHECK_CHARS

#define PATH_FRAME_CHECK_CHARS ( input_path,
expect_hasChars )
Value:
{ \
const bool ret = BLI_path_frame_check_chars(input_path); \
if (expect_hasChars) { \
EXPECT_TRUE(ret); \
} \
else { \
EXPECT_FALSE(ret); \
} \
} \
((void)0)

Definition at line 1224 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_FRAME_GET

#define PATH_FRAME_GET ( input_path,
expect_frame,
expect_numdigits,
expect_pathisvalid )
Value:
{ \
char path[FILE_MAX]; \
int out_frame = -1, out_numdigits = -1; \
STRNCPY(path, input_path); \
const bool ret = BLI_path_frame_get(path, &out_frame, &out_numdigits); \
if (expect_pathisvalid) { \
EXPECT_TRUE(ret); \
} \
else { \
EXPECT_FALSE(ret); \
} \
EXPECT_EQ(out_frame, expect_frame); \
EXPECT_EQ(out_numdigits, expect_numdigits); \
} \
((void)0)

Definition at line 1309 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_FRAME_RANGE

#define PATH_FRAME_RANGE ( input_path,
sta,
end,
digits,
expect_outpath )
Value:
{ \
char path[FILE_MAX]; \
bool ret; \
STRNCPY(path, input_path); \
ret = BLI_path_frame_range(path, sizeof(path), sta, end, digits); \
if (expect_outpath == nullptr) { \
EXPECT_FALSE(ret); \
} \
else { \
EXPECT_TRUE(ret); \
EXPECT_STREQ(path, expect_outpath); \
} \
} \
((void)0)

Definition at line 1261 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_FRAME_STRIP

#define PATH_FRAME_STRIP ( input_path,
expect_path,
expect_ext )
Value:
{ \
char path[FILE_MAX]; \
char ext[FILE_MAX]; \
STRNCPY(path, (input_path)); \
BLI_path_frame_strip(path, ext, sizeof(ext)); \
EXPECT_STREQ(path, expect_path); \
EXPECT_STREQ(ext, expect_ext); \
} \
((void)0)

Definition at line 982 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_REL

#define PATH_REL ( abs_path,
ref_path,
rel_path_expect )
Value:
{ \
char path[FILE_MAX]; \
const char *ref_path_test = ref_path; \
STRNCPY(path, abs_path); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '/', '\\'); \
ref_path_test = str_replace_char_strdup(ref_path_test, '/', '\\'); \
} \
BLI_path_rel(path, ref_path_test); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '\\', '/'); \
free((void *)ref_path_test); \
} \
EXPECT_STREQ(path, rel_path_expect); \
} \
void(0)

Definition at line 1667 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), blender::TEST(), and blender::TEST().

◆ PATH_SEQ_DECODE

#define PATH_SEQ_DECODE ( path_literal,
expect_result,
expect_head,
expect_tail,
expect_numdigits )
Value:
{ \
const char *path = path_literal; \
char head[FILE_MAX]; \
char tail[FILE_MAX]; \
ushort numdigits = 0; \
const int result = BLI_path_sequence_decode( \
path, head, sizeof(head), tail, sizeof(tail), &numdigits); \
EXPECT_EQ(result, expect_result); \
EXPECT_STREQ(head, expect_head); \
EXPECT_STREQ(tail, expect_tail); \
EXPECT_EQ(numdigits, expect_numdigits); \
} \
(void)0;

Definition at line 1348 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_SLASH_ENSURE

#define PATH_SLASH_ENSURE ( input,
size,
output_expect,
length_expect )
Value:
{ \
char path[size] = input; \
if (SEP == '\\') { \
BLI_string_replace_char(path, '/', '\\'); \
} \
int result = BLI_path_slash_ensure(path, size); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '\\', '/'); \
} \
EXPECT_STREQ(path, output_expect); \
EXPECT_EQ(result, length_expect); \
} \
((void)0)

Definition at line 1491 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_SLASH_FIND

#define PATH_SLASH_FIND ( path,
expect_index )
Value:
{ \
const char *result = BLI_path_slash_find(path); \
EXPECT_EQ(result, &path[expect_index]); \
} \
(void)0;

Definition at line 1427 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_SLASH_NATIVE

#define PATH_SLASH_NATIVE ( input,
expected )
Value:
{ \
char path[FILE_MAX] = input; \
BLI_path_slash_native(path); \
EXPECT_STREQ(path, expected); \
} \
((void)0)

Definition at line 1600 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_SLASH_RFIND

#define PATH_SLASH_RFIND ( path,
expect_index )
Value:
{ \
const char *result = BLI_path_slash_rfind(path); \
EXPECT_STREQ(result, &path[expect_index]); \
} \
(void)0;

Definition at line 1458 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_SLASH_RSTRIP

#define PATH_SLASH_RSTRIP ( input,
expected )
Value:
{ \
char path[FILE_MAX] = input; \
if (SEP == '\\') { \
BLI_string_replace_char(path, '/', '\\'); \
} \
BLI_path_slash_rstrip(path); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '\\', '/'); \
} \
EXPECT_STREQ(path, expected); \
} \
((void)0)

Definition at line 1529 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_SLASH_SKIP

#define PATH_SLASH_SKIP ( input,
expected )
Value:
{ \
char path[FILE_MAX] = input; \
if (SEP == '\\') { \
BLI_string_replace_char(path, '/', '\\'); \
} \
const char *skipped = BLI_path_slash_skip(path); \
if (SEP == '\\') { \
BLI_string_replace_char(path, '\\', '/'); \
} \
EXPECT_STREQ(skipped, expected); \
} \
((void)0)

Definition at line 1565 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ PATH_SUFFIX

#define PATH_SUFFIX ( path_literal,
path_literal_max,
sep,
suffix,
expect_result,
expect_path )
Value:
{ \
char path[FILE_MAX] = path_literal; \
const bool result = BLI_path_suffix(path, path_literal_max, suffix, sep); \
EXPECT_EQ(result, expect_result); \
EXPECT_STREQ(path, expect_path); \
} \
(void)0;

Definition at line 1385 of file BLI_path_utils_test.cc.

Referenced by blender::TEST().

◆ TEST_STR [1/2]

#define TEST_STR   ".//a//.//b//.//c//.//"

Definition at line 400 of file BLI_path_utils_test.cc.

◆ TEST_STR [2/2]

#define TEST_STR   "./a/./b/./c/."

Definition at line 400 of file BLI_path_utils_test.cc.

Referenced by blender::TEST(), blender::TEST(), blender::TEST(), and blender::TEST().