Blender
V5.0
source
blender
blenlib
tests
BLI_tempfile_test.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: Apache-2.0 */
4
5
#include "
BLI_tempfile.h
"
6
7
#include "
BLI_fileops.h
"
8
#include "
BLI_path_utils.hh
"
9
10
#include "testing/testing.h"
11
12
namespace
blender::tests
{
13
14
TEST
(BLI_tempfile,
BLI_temp_directory_path_get
)
15
{
16
char
temp_dir[
FILE_MAX
];
17
BLI_temp_directory_path_get
(temp_dir,
sizeof
(temp_dir));
18
19
ASSERT_STRNE(temp_dir,
""
);
20
21
EXPECT_EQ
(temp_dir[strlen(temp_dir) - 1],
SEP
);
22
23
EXPECT_TRUE(
BLI_exists
(temp_dir));
24
EXPECT_TRUE(
BLI_is_dir
(temp_dir));
25
26
EXPECT_TRUE(
BLI_path_is_abs_from_cwd
(temp_dir));
27
}
28
29
}
// namespace blender::tests
EXPECT_EQ
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
BLI_fileops.h
File and directory operations.
BLI_exists
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition
storage.cc:360
BLI_is_dir
bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition
storage.cc:443
BLI_path_utils.hh
FILE_MAX
#define FILE_MAX
Definition
BLI_path_utils.hh:668
BLI_path_is_abs_from_cwd
bool BLI_path_is_abs_from_cwd(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
Definition
path_utils.cc:1213
SEP
#define SEP
Definition
BLI_path_utils.hh:728
BLI_tempfile.h
BLI_temp_directory_path_get
bool void BLI_temp_directory_path_get(char *tempdir, const size_t tempdir_maxncpy) ATTR_NONNULL(1)
Definition
tempfile.cc:57
blender::tests
Definition
BLF_tests.cc:9
blender::tests::TEST
TEST(blf_load, load)
Definition
BLF_tests.cc:34
Generated on
for Blender by
doxygen
1.16.1