Made 'rename' blend mode default for buddy scripts

This commit is contained in:
Matthias Koefferlein 2021-04-04 21:34:43 +02:00
parent ac9aa475ab
commit 7b9a1ffdee
2 changed files with 23 additions and 4 deletions

View File

@ -39,7 +39,7 @@ GenericReaderOptions::GenericReaderOptions ()
m_common_enable_text_objects = load_options.get_option_by_name ("text_enabled").to_bool ();
m_common_enable_properties = load_options.get_option_by_name ("properties_enabled").to_bool ();
m_cell_conflict_resolution = load_options.get_options<db::CommonReaderOptions> ().cell_conflict_resolution;
m_cell_conflict_resolution = (unsigned int) db::CellConflictResolution::RenameCell;
m_gds2_box_mode = load_options.get_option_by_name ("gds2_box_mode").to_uint ();
m_gds2_allow_big_records = load_options.get_option_by_name ("gds2_allow_big_records").to_bool ();
@ -200,12 +200,12 @@ GenericReaderOptions::add_options (tl::CommandLineOptions &cmd)
)
<< tl::arg (group +
"--" + m_long_prefix + "blend-mode=mode", &m_cell_conflict_resolution, "Specifies how cell conflicts are resolved when using file concatenation",
"When concatenating file with '+', the reader will handle cells with the same names according to this mode:\n"
"When concatenating files with '+', the reader will handle cells with identical names according to this mode:\n"
"\n"
"* 0: joins everything (default, risk of spoiling layouts)\n"
"* 0: joins everything (unsafe)\n"
"* 1: overwrite\n"
"* 2: skip new cell\n"
"* 3: create a variant with a new name"
"* 3: rename cell (safe, default)"
)
;
}

View File

@ -294,3 +294,22 @@ TEST(10)
EXPECT_EQ (stream_opt.get_option_by_name ("oasis_expect_strict_mode").to_int (), 1);
}
// Testing reader options - blend mode "Rename" is default
TEST(11)
{
bd::GenericReaderOptions opt;
tl::CommandLineOptions cmd;
opt.add_options (cmd);
const char *argv[] = { "x" };
cmd.parse (sizeof (argv) / sizeof (argv[0]), (char **) argv);
db::LoadLayoutOptions stream_opt;
opt.configure (stream_opt);
EXPECT_EQ (stream_opt.get_option_by_name ("cell_conflict_resolution").to_string (), "RenameCell");
}