Blender V5.3
obj_exporter_tests.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 <gtest/gtest.h>
6#include <memory>
7#include <string>
8#include <system_error>
9
10#include "testing/testing.h"
12
13#include "BKE_appdir.hh"
14#include "BKE_blender_version.h"
15#include "BKE_gtest_base.hh"
16#include "BKE_main.hh"
17
18#include "BLI_fileops.hh"
19#include "BLI_string.hh"
20
21#include "BLO_readfile.hh"
22
23#include "DEG_depsgraph.hh"
24
26#include "obj_export_nurbs.hh"
27#include "obj_exporter.hh"
28
29namespace blender::io::obj {
30/* Set this true to keep comparison-failing test output in temp file directory. */
31constexpr bool save_failing_test_output = false;
32
33/* This is also the test name. */
35 public:
39 bool load_file_and_depsgraph(const std::string &filepath,
40 const eEvaluationMode eval_mode = DAG_EVAL_VIEWPORT)
41 {
42 if (!blendfile_load(filepath.c_str())) {
43 return false;
44 }
45 depsgraph_create(eval_mode);
46 return true;
47 }
48};
49
50const std::string all_objects_file = "io_tests" SEP_STR "blend_scene" SEP_STR "all_objects.blend";
51
52TEST_F(OBJExportTest, filter_objects_curves_as_mesh)
53{
54 OBJExportParams params;
55 if (!load_file_and_depsgraph(all_objects_file)) {
56 ADD_FAILURE();
57 return;
58 }
59 auto [objmeshes, objcurves]{filter_supported_objects(depsgraph, params)};
60 EXPECT_EQ(objmeshes.size(), 21);
61 EXPECT_EQ(objcurves.size(), 0);
62}
63
64TEST_F(OBJExportTest, filter_objects_curves_as_nurbs)
65{
66 OBJExportParams params;
67 if (!load_file_and_depsgraph(all_objects_file)) {
68 ADD_FAILURE();
69 return;
70 }
71 params.export_curves_as_nurbs = true;
72 auto [objmeshes, objcurves]{filter_supported_objects(depsgraph, params)};
73 EXPECT_EQ(objmeshes.size(), 18);
74 EXPECT_EQ(objcurves.size(), 3);
75}
76
77TEST_F(OBJExportTest, filter_objects_selected)
78{
79 OBJExportParams params;
80 if (!load_file_and_depsgraph(all_objects_file)) {
81 ADD_FAILURE();
82 return;
83 }
84 params.export_selected_objects = true;
85 params.export_curves_as_nurbs = true;
86 auto [objmeshes, objcurves]{filter_supported_objects(depsgraph, params)};
87 EXPECT_EQ(objmeshes.size(), 1);
88 EXPECT_EQ(objcurves.size(), 0);
89}
90
91TEST(obj_exporter_utils, append_negative_frame_to_filename)
92{
93 const char path_original[FILE_MAX] = SEP_STR "my_file.obj";
94 const char path_truth[FILE_MAX] = SEP_STR "my_file-0012.obj";
95 const int frame = -12;
96 char path_with_frame[FILE_MAX] = {0};
97 const bool ok = append_frame_to_filename(path_original, frame, path_with_frame);
98 EXPECT_TRUE(ok);
99 EXPECT_STREQ(path_with_frame, path_truth);
100}
101
102TEST(obj_exporter_utils, append_positive_frame_to_filename)
103{
104 const char path_original[FILE_MAX] = SEP_STR "my_file.obj";
105 const char path_truth[FILE_MAX] = SEP_STR "my_file0012.obj";
106 const int frame = 12;
107 char path_with_frame[FILE_MAX] = {0};
108 const bool ok = append_frame_to_filename(path_original, frame, path_with_frame);
109 EXPECT_TRUE(ok);
110 EXPECT_STREQ(path_with_frame, path_truth);
111}
112
113TEST(obj_exporter_utils, append_large_positive_frame_to_filename)
114{
115 const char path_original[FILE_MAX] = SEP_STR "my_file.obj";
116 const char path_truth[FILE_MAX] = SEP_STR "my_file1234567.obj";
117 const int frame = 1234567;
118 char path_with_frame[FILE_MAX] = {0};
119 const bool ok = append_frame_to_filename(path_original, frame, path_with_frame);
120 EXPECT_TRUE(ok);
121 EXPECT_STREQ(path_with_frame, path_truth);
122}
123
124static std::string read_temp_file_in_string(const std::string &file_path)
125{
126 std::string res;
127 size_t buffer_len;
128 char *buffer = BLI_file_read_text_as_mem(file_path.c_str(), 0, &buffer_len);
129 if (buffer != nullptr) {
130 res.assign(buffer, buffer_len);
131 MEM_delete(buffer);
132 }
133 return res;
134}
135
136class ObjExporterWriterTest : public testing::Test {
137 protected:
138 void SetUp() override
139 {
140 BKE_tempdir_init(nullptr);
141 }
142
143 void TearDown() override
144 {
146 }
147
149 {
150 /* Use Latin Capital Letter A with Ogonek, Cyrillic Capital Letter Zhe
151 * at the end, to test I/O on non-English file names. */
152 const char *const temp_file_path = "output\xc4\x84\xd0\x96.OBJ";
153
154 return std::string(BKE_tempdir_session()) + SEP_STR + std::string(temp_file_path);
155 }
156
157 std::unique_ptr<OBJWriter> init_writer(const OBJExportParams &params,
158 const std::string &out_filepath)
159 {
160 try {
161 auto writer = std::make_unique<OBJWriter>(out_filepath.c_str(), params);
162 return writer;
163 }
164 catch (const std::system_error &ex) {
165 fprintf(stderr, "[%s] %s\n", ex.code().category().name(), ex.what());
166 return nullptr;
167 }
168 }
169};
170
172{
173 /* Because testing doesn't fully initialize Blender, we need the following. */
174 BKE_tempdir_init(nullptr);
175 std::string out_file_path = get_temp_obj_filename();
176 {
177 OBJExportParams params;
178 std::unique_ptr<OBJWriter> writer = init_writer(params, out_file_path);
179 if (!writer) {
180 ADD_FAILURE();
181 return;
182 }
183 writer->write_header();
184 }
185 const std::string result = read_temp_file_in_string(out_file_path);
186 using namespace std::string_literals;
187 ASSERT_EQ(result, "# Blender "s + BKE_blender_version_string() + "\n" + "# www.blender.org\n");
188}
189
191{
192 std::string out_file_path = get_temp_obj_filename();
193 {
194 OBJExportParams params;
195 std::unique_ptr<OBJWriter> writer = init_writer(params, out_file_path);
196 if (!writer) {
197 ADD_FAILURE();
198 return;
199 }
200 writer->write_mtllib_name("/Users/blah.mtl");
201 writer->write_mtllib_name("\\C:\\blah.mtl");
202 }
203 const std::string result = read_temp_file_in_string(out_file_path);
204 ASSERT_EQ(result, "mtllib blah.mtl\nmtllib blah.mtl\n");
205}
206
207TEST(obj_exporter_writer, format_handler_buffer_chunking)
208{
209 /* Use a tiny buffer chunk size, so that the test below ends up creating several blocks. */
210 FormatHandler h(16);
211 h.write_obj_object("abc");
212 h.write_obj_object("abcd");
213 h.write_obj_object("abcde");
214 h.write_obj_object("abcdef");
215 h.write_obj_object("012345678901234567890123456789abcd");
216 h.write_obj_object("123");
220 h.write_obj_nurbs_parm(0.0f);
222
223 size_t got_blocks = h.get_block_count();
224 ASSERT_EQ(got_blocks, 6);
225
226 std::string got_string = h.get_as_string();
227 using namespace std::string_literals;
228 const char *expected = R"(o abc
229o abcd
230o abcde
231o abcdef
232o 012345678901234567890123456789abcd
233o 123
234curv
235parm u 0.000000
236)";
237 ASSERT_EQ(got_string, expected);
238}
239
240/* Return true if string #a and string #b are equal after their first newline. */
241static bool strings_equal_after_first_lines(const std::string &a, const std::string &b)
242{
243 const size_t a_len = a.size();
244 const size_t b_len = b.size();
245 const size_t a_next = a.find_first_of('\n');
246 const size_t b_next = b.find_first_of('\n');
247 if (a_next == std::string::npos) {
248 printf("No newline found in evaluated string\n");
249 return false;
250 }
251 if (b_next == std::string::npos) {
252 printf("No newline found in the golden string\n");
253 return false;
254 }
255 const size_t a_sublen = a_len - a_next;
256 const size_t b_sublen = b_len - b_next;
257 if (a_sublen != b_sublen) {
258 printf("Mismatching string length, evaluated contains %zu chars, while golden has %zu\n",
259 a_sublen,
260 b_sublen);
261 }
262 if (a.compare(a_next, a_sublen, b, b_next, b_sublen) != 0) {
263 for (int i = 0; i < std::min(a_sublen, b_sublen); ++i) {
264 if (a[a_next + i] != b[b_next + i]) {
265 printf("Difference found at pos %zu of a\n", a_next + i);
266 printf("a: %s ...\n", a.substr(a_next + i, 100).c_str());
267 printf("b: %s ...\n", b.substr(b_next + i, 100).c_str());
268 return false;
270 }
271 return false;
272 }
273 return true;
274}
275
276/* From here on, tests are whole file tests, testing for golden output. */
277class OBJExportRegressionTest : public OBJExportTest {
278 public:
286 void compare_obj_export_to_golden(const std::string &blendfile,
287 const std::string &golden_obj,
288 const std::string &golden_mtl,
289 OBJExportParams &params)
290 {
292 return;
293 }
294 /* Because testing doesn't fully initialize Blender, we need the following. */
295 BKE_tempdir_init(nullptr);
296 std::string tempdir = std::string(BKE_tempdir_base());
297 std::string out_file_path = tempdir + BLI_path_basename(golden_obj.c_str());
298 STRNCPY(params.filepath, out_file_path.c_str());
299 params.blen_filepath = bfile->main->filepath;
300 std::string golden_file_path = tests::flags_test_asset_dir() + SEP_STR + golden_obj;
302 golden_file_path.c_str(), params.file_base_for_tests, sizeof(params.file_base_for_tests));
303 export_frame(depsgraph, params, out_file_path.c_str());
304 std::string output_str = read_temp_file_in_string(out_file_path);
305
306 std::string golden_str = read_temp_file_in_string(golden_file_path);
307 bool are_equal = strings_equal_after_first_lines(output_str, golden_str);
308 if (!are_equal) {
309 printf("failed test for file: %s\n", golden_file_path.c_str());
311 printf("failing test output in %s\n", out_file_path.c_str());
312 }
313 }
314 ASSERT_TRUE(are_equal);
315 if (!save_failing_test_output || are_equal) {
316 BLI_delete(out_file_path.c_str(), false, false);
317 }
318 if (!golden_mtl.empty()) {
319 std::string out_mtl_file_path = tempdir + BLI_path_basename(golden_mtl.c_str());
320 std::string output_mtl_str = read_temp_file_in_string(out_mtl_file_path);
321 std::string golden_mtl_file_path = tests::flags_test_asset_dir() + SEP_STR + golden_mtl;
322 std::string golden_mtl_str = read_temp_file_in_string(golden_mtl_file_path);
323 are_equal = strings_equal_after_first_lines(output_mtl_str, golden_mtl_str);
324 if (!are_equal) {
325 printf("failed test for mtl file: %s\n", golden_mtl_file_path.c_str());
327 printf("failing test output in %s\n", out_mtl_file_path.c_str());
328 }
329 }
330 ASSERT_TRUE(are_equal);
331 if (!save_failing_test_output || are_equal) {
332 BLI_delete(out_mtl_file_path.c_str(), false, false);
333 }
334 }
335 }
336};
337
340 OBJExportParams params;
341 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "all_tris.blend",
342 "io_tests" SEP_STR "obj" SEP_STR "all_tris.obj",
343 "io_tests" SEP_STR "obj" SEP_STR "all_tris.mtl",
344 params);
345}
346
347TEST_F(OBJExportRegressionTest, all_quads)
348{
349 OBJExportParams params;
350 params.global_scale = 2.0f;
351 params.export_materials = false;
352 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "all_quads.blend",
353 "io_tests" SEP_STR "obj" SEP_STR "all_quads.obj",
354 "",
355 params);
356}
357
358TEST_F(OBJExportRegressionTest, fgons)
359{
360 OBJExportParams params;
361 params.forward_axis = IO_AXIS_Y;
363 params.export_materials = false;
364 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "fgons.blend",
365 "io_tests" SEP_STR "obj" SEP_STR "fgons.obj",
366 "",
367 params);
368}
369
370TEST_F(OBJExportRegressionTest, edges)
371{
372 OBJExportParams params;
373 params.forward_axis = IO_AXIS_Y;
375 params.export_materials = false;
376 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "edges.blend",
377 "io_tests" SEP_STR "obj" SEP_STR "edges.obj",
378 "",
379 params);
380}
381
382TEST_F(OBJExportRegressionTest, vertices)
383{
384 OBJExportParams params;
385 params.forward_axis = IO_AXIS_Y;
386 params.up_axis = IO_AXIS_Z;
387 params.export_materials = false;
388 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
389 "cube_loose_edges_verts.blend",
390 "io_tests" SEP_STR "obj" SEP_STR "cube_loose_edges_verts.obj",
391 "",
392 params);
393}
394
395TEST_F(OBJExportRegressionTest, cube_loose_edges)
396{
397 OBJExportParams params;
398 params.forward_axis = IO_AXIS_Y;
400 params.export_materials = false;
401 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "vertices.blend",
402 "io_tests" SEP_STR "obj" SEP_STR "vertices.obj",
403 "",
404 params);
405}
406
407TEST_F(OBJExportRegressionTest, non_uniform_scale)
408{
409 OBJExportParams params;
410 params.export_materials = false;
411 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
412 "non_uniform_scale.blend",
413 "io_tests" SEP_STR "obj" SEP_STR "non_uniform_scale.obj",
414 "",
415 params);
416}
417
418TEST_F(OBJExportRegressionTest, nurbs_as_nurbs)
419{
420 OBJExportParams params;
421 params.forward_axis = IO_AXIS_Y;
422 params.up_axis = IO_AXIS_Z;
423 params.export_materials = false;
424 params.export_curves_as_nurbs = true;
425 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "nurbs.blend",
426 "io_tests" SEP_STR "obj" SEP_STR "nurbs.obj",
427 "",
428 params);
429}
430
431TEST_F(OBJExportRegressionTest, nurbs_curves_as_nurbs)
432{
433 OBJExportParams params;
434 params.forward_axis = IO_AXIS_Y;
435 params.up_axis = IO_AXIS_Z;
436 params.export_materials = false;
437 params.export_curves_as_nurbs = true;
438 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "nurbs_curves.blend",
439 "io_tests" SEP_STR "obj" SEP_STR "nurbs_curves.obj",
440 "",
441 params);
442}
443
444TEST_F(OBJExportRegressionTest, nurbs_as_mesh)
445{
446 OBJExportParams params;
447 params.forward_axis = IO_AXIS_Y;
448 params.up_axis = IO_AXIS_Z;
449 params.export_materials = false;
450 params.export_curves_as_nurbs = false;
451 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "nurbs.blend",
452 "io_tests" SEP_STR "obj" SEP_STR "nurbs_mesh.obj",
453 "",
454 params);
455}
456
457TEST_F(OBJExportRegressionTest, cube_all_data_triangulated)
458{
459 OBJExportParams params;
460 params.forward_axis = IO_AXIS_Y;
461 params.up_axis = IO_AXIS_Z;
462 params.export_materials = false;
463 params.export_triangulated_mesh = true;
464 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "cube_all_data.blend",
465 "io_tests" SEP_STR "obj" SEP_STR "cube_all_data_triangulated.obj",
466 "",
467 params);
468}
469
470TEST_F(OBJExportRegressionTest, cube_normal_edit)
471{
472 OBJExportParams params;
473 params.forward_axis = IO_AXIS_Y;
474 params.up_axis = IO_AXIS_Z;
475 params.export_materials = false;
476 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
477 "cube_normal_edit.blend",
478 "io_tests" SEP_STR "obj" SEP_STR "cube_normal_edit.obj",
479 "",
480 params);
481}
482
483TEST_F(OBJExportRegressionTest, cube_vertex_groups)
484{
485 OBJExportParams params;
486 params.export_materials = false;
487 params.export_normals = false;
488 params.export_uv = false;
489 params.export_vertex_groups = true;
490 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
491 "cube_vertex_groups.blend",
492 "io_tests" SEP_STR "obj" SEP_STR "cube_vertex_groups.obj",
493 "",
494 params);
495}
496
497TEST_F(OBJExportRegressionTest, cubes_positioned)
498{
499 OBJExportParams params;
500 params.export_materials = false;
501 params.global_scale = 2.0f;
502 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
503 "cubes_positioned.blend",
504 "io_tests" SEP_STR "obj" SEP_STR "cubes_positioned.obj",
505 "",
506 params);
507}
508
509TEST_F(OBJExportRegressionTest, cubes_vertex_colors)
510{
511 OBJExportParams params;
512 params.export_colors = true;
513 params.export_normals = false;
514 params.export_uv = false;
515 params.export_materials = false;
516 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
517 "cubes_vertex_colors.blend",
518 "io_tests" SEP_STR "obj" SEP_STR "cubes_vertex_colors.obj",
519 "",
520 params);
521}
522
523TEST_F(OBJExportRegressionTest, cubes_with_textures_strip)
524{
525 OBJExportParams params;
527 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
528 "cubes_with_textures.blend",
529 "io_tests" SEP_STR "obj" SEP_STR "cubes_with_textures.obj",
530 "io_tests" SEP_STR "obj" SEP_STR "cubes_with_textures.mtl",
531 params);
532}
533
534TEST_F(OBJExportRegressionTest, cubes_with_textures_relative)
535{
536 OBJExportParams params;
538 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
539 "cubes_with_textures.blend",
540 "io_tests" SEP_STR "obj" SEP_STR "cubes_with_textures_rel.obj",
541 "io_tests" SEP_STR "obj" SEP_STR "cubes_with_textures_rel.mtl",
542 params);
543}
544
545TEST_F(OBJExportRegressionTest, suzanne_all_data)
546{
547 OBJExportParams params;
548 params.forward_axis = IO_AXIS_Y;
549 params.up_axis = IO_AXIS_Z;
550 params.export_materials = false;
551 params.export_smooth_groups = true;
552 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR
553 "suzanne_all_data.blend",
554 "io_tests" SEP_STR "obj" SEP_STR "suzanne_all_data.obj",
555 "",
556 params);
557}
558
559TEST_F(OBJExportRegressionTest, all_curves)
560{
562 params.export_materials = false;
563 compare_obj_export_to_golden("io_tests" SEP_STR "blend_scene" SEP_STR "all_curves.blend",
564 "io_tests" SEP_STR "obj" SEP_STR "all_curves.obj",
565 "",
566 params);
567}
568
569TEST_F(OBJExportRegressionTest, all_curves_as_nurbs)
570{
571 OBJExportParams params;
572 params.export_materials = false;
573 params.export_curves_as_nurbs = true;
574 compare_obj_export_to_golden("io_tests" SEP_STR "blend_scene" SEP_STR "all_curves.blend",
575 "io_tests" SEP_STR "obj" SEP_STR "all_curves_as_nurbs.obj",
576 "",
577 params);
578}
579
580TEST_F(OBJExportRegressionTest, all_objects)
581{
582 OBJExportParams params;
583 params.forward_axis = IO_AXIS_Y;
584 params.up_axis = IO_AXIS_Z;
585 params.export_smooth_groups = true;
586 params.export_colors = true;
587 compare_obj_export_to_golden("io_tests" SEP_STR "blend_scene" SEP_STR "all_objects.blend",
588 "io_tests" SEP_STR "obj" SEP_STR "all_objects.obj",
589 "io_tests" SEP_STR "obj" SEP_STR "all_objects.mtl",
590 params);
591}
592
593TEST_F(OBJExportRegressionTest, all_objects_mat_groups)
594{
595 OBJExportParams params;
596 params.forward_axis = IO_AXIS_Y;
597 params.up_axis = IO_AXIS_Z;
598 params.export_smooth_groups = true;
599 params.export_material_groups = true;
600 compare_obj_export_to_golden("io_tests" SEP_STR "blend_scene" SEP_STR "all_objects.blend",
601 "io_tests" SEP_STR "obj" SEP_STR "all_objects_mat_groups.obj",
602 "io_tests" SEP_STR "obj" SEP_STR "all_objects_mat_groups.mtl",
603 params);
604}
605
606TEST_F(OBJExportRegressionTest, materials_without_pbr)
607{
608 OBJExportParams params;
609 params.export_normals = false;
611 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "materials_pbr.blend",
612 "io_tests" SEP_STR "obj" SEP_STR "materials_without_pbr.obj",
613 "io_tests" SEP_STR "obj" SEP_STR "materials_without_pbr.mtl",
614 params);
615}
616
617TEST_F(OBJExportRegressionTest, materials_pbr)
618{
619 OBJExportParams params;
620 params.export_normals = false;
622 params.export_pbr_extensions = true;
623 compare_obj_export_to_golden("io_tests" SEP_STR "blend_geometry" SEP_STR "materials_pbr.blend",
624 "io_tests" SEP_STR "obj" SEP_STR "materials_pbr.obj",
625 "io_tests" SEP_STR "obj" SEP_STR "materials_pbr.mtl",
626 params);
627}
628
629} // namespace blender::io::obj
File and directory operations.
#define FILE_MAX
external readfile function prototypes.
virtual void depsgraph_create(eEvaluationMode depsgraph_evaluation_mode)
std::string get_as_string() const
void compare_obj_export_to_golden(const std::string &blendfile, const std::string &golden_obj, const std::string &golden_mtl, OBJExportParams &params)
bool load_file_and_depsgraph(const std::string &filepath, const eEvaluationMode eval_mode=DAG_EVAL_VIEWPORT)
std::unique_ptr< OBJWriter > init_writer(const OBJExportParams &params, const std::string &out_filepath)
#define printf
#define EXPECT_TRUE(result)
static bool strings_equal_after_first_lines(const std::string &a, const std::string &b)
std::pair< Vector< std::unique_ptr< OBJMesh > >, Vector< std::unique_ptr< IOBJCurve > > > filter_supported_objects(Depsgraph *depsgraph, const OBJExportParams &export_params)
bool append_frame_to_filename(const char *filepath, const int frame, char r_filepath_with_frames[FILE_MAX])
TEST_F(OBJExportTest, filter_objects_curves_as_mesh)
TEST(obj_exporter_utils, append_negative_frame_to_filename)
constexpr bool save_failing_test_output
const std::string all_objects_file
static std::string read_temp_file_in_string(const std::string &file_path)
void export_frame(Depsgraph *depsgraph, const OBJExportParams &export_params, const char *filepath)
TEST_F(AbstractHierarchyIteratorTest, ExportHierarchyTest)
void BKE_tempdir_session_purge()
Definition appdir.cc:1293
char * STRNCPY(char(&dst)[N], const char *src)
const char * BKE_tempdir_session() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1283
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
char * BLI_file_read_text_as_mem(const char *filepath, size_t pad_bytes, size_t *r_size)
Definition storage.cc:539
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL()
@ DAG_EVAL_VIEWPORT
const char * BKE_tempdir_base() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1288
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
const char * BKE_blender_version_string()
Definition blender.cc:147
void BKE_tempdir_init(const char *userdir)
Definition appdir.cc:1245
char filepath[1024]
Definition BKE_main.hh:267
ePathReferenceMode path_mode
char file_base_for_tests[FILE_MAX]
#define SEP_STR
Definition unit.cc:41