Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/tests/BLI_fileops.cc
- This file was added.
| /* Apache License, Version 2.0 */ | |||||
| #include "BLI_fileops.hh" | |||||
| #include "testing/testing.h" | |||||
| namespace blender::tests { | |||||
| TEST(fileops, fstream_reading) | |||||
| { | |||||
| const std::string test_files_dir = blender::tests::flags_test_asset_dir(); | |||||
| if (test_files_dir.empty()) { | |||||
| FAIL(); | |||||
| } | |||||
| const std::string filename = test_files_dir + "/asset_library/новый/blender_assets.cats.txt"; | |||||
| fstream in(filename, std::ios_base::in); | |||||
| ASSERT_TRUE(in.is_open()) << "could not open " << filename; | |||||
| in.close(); /* This should not crash. */ | |||||
| /* Reading the file not tested here. That's deferred to `std::fstream` anyway. */ | |||||
| } | |||||
| } // namespace blender::tests | |||||