Blender V4.3
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
12namespace blender::tests {
13
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(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:350
bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:433
#define FILE_MAX
bool BLI_path_is_abs_from_cwd(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define SEP
bool void BLI_temp_directory_path_get(char *tempdir, const size_t tempdir_maxncpy) ATTR_NONNULL(1)
Definition tempfile.cc:53
TEST(any, DefaultConstructor)