Allow passing UID to importer
This helps, for importers spitting out new resources to the res:// filesystem to actually hash them to generate deterministic UIDs. This PR also fixes the determinism for translations.
This commit is contained in:
@@ -161,7 +161,7 @@ TEST_CASE("[TranslationCSV] CSV import") {
|
||||
|
||||
List<String> gen_files;
|
||||
|
||||
Error result = import_csv_translation->import(TestUtils::get_data_path("translations.csv"),
|
||||
Error result = import_csv_translation->import(0, TestUtils::get_data_path("translations.csv"),
|
||||
"", options, nullptr, &gen_files);
|
||||
CHECK(result == OK);
|
||||
CHECK(gen_files.size() == 4);
|
||||
|
||||
@@ -162,7 +162,7 @@ void run_test(String file_name, AudioStreamWAV::Format data_format, bool stereo,
|
||||
// Compressed streams can't be saved, disable compression.
|
||||
options_map["compress/mode"] = 0;
|
||||
|
||||
REQUIRE(wav_importer->import(save_path, save_path, options_map, nullptr) == OK);
|
||||
REQUIRE(wav_importer->import(0, save_path, save_path, options_map, nullptr) == OK);
|
||||
|
||||
String load_path = save_path + "." + wav_importer->get_save_extension();
|
||||
Ref<AudioStreamWAV> loaded_stream = ResourceLoader::load(load_path, "AudioStreamWAV", ResourceFormatImporter::CACHE_MODE_IGNORE, &error);
|
||||
|
||||
Reference in New Issue
Block a user