Merge remote-tracking branch 'origin/feat/rsync-checksum-choice-alias' into dev
This commit is contained in:
+33
-1
@@ -753,6 +753,21 @@ static void test_parse_args_no_preserve_blocks_implicit_metadata() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Checksum-choice spellings are recognized and rejected until algorithms are implemented. */
|
||||
static void test_parse_args_checksum_choice_aliases() {
|
||||
static const char* const options[] = {"--checksum-choice", "--cc"};
|
||||
|
||||
for (size_t i = 0; i < sizeof(options) / sizeof(options[0]); i++) {
|
||||
Config* cfg = config_create();
|
||||
char* argv[] = {"fastsync", (char*)options[i], "xxh64", "/src", "/dst"};
|
||||
int positional_args[2];
|
||||
int positional_count = 0;
|
||||
|
||||
EXPECT_EQ_INT(parse_args(cfg, 5, argv, positional_args, &positional_count), -1);
|
||||
config_delete(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_parse_args_rejects_unsafe_negation() {
|
||||
static const char* const options[] = {"--no-archive", "--no-timeout", "--no-unknown"};
|
||||
for (size_t i = 0; i < sizeof(options) / sizeof(options[0]); i++) {
|
||||
@@ -766,6 +781,21 @@ static void test_parse_args_rejects_unsafe_negation() {
|
||||
}
|
||||
}
|
||||
|
||||
/* Both checksum-choice spellings require a value. */
|
||||
static void test_parse_args_checksum_choice_requires_value() {
|
||||
static const char* const options[] = {"--checksum-choice", "--cc"};
|
||||
|
||||
for (size_t i = 0; i < sizeof(options) / sizeof(options[0]); i++) {
|
||||
Config* cfg = config_create();
|
||||
char* argv[] = {"fastsync", (char*)options[i]};
|
||||
int positional_args[2];
|
||||
int positional_count = 0;
|
||||
|
||||
EXPECT_EQ_INT(parse_args(cfg, 2, argv, positional_args, &positional_count), -1);
|
||||
config_delete(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_parse_args_old_args() {
|
||||
Config* cfg = config_create();
|
||||
char* argv[] = {"fastsync", "--old-args", "/src", "/dst"};
|
||||
@@ -1059,7 +1089,7 @@ void test_client_cli() {
|
||||
test_parse_args_info_verbose_order();
|
||||
test_parse_args_rejects_invalid_info_flag();
|
||||
test_parse_args_archive();
|
||||
test_parse_args_negations();
|
||||
test_parse_args_negations();
|
||||
test_parse_args_negation_order();
|
||||
test_parse_args_no_preserve_blocks_implicit_metadata();
|
||||
test_parse_args_rejects_unsafe_negation();
|
||||
@@ -1080,4 +1110,6 @@ test_parse_args_negations();
|
||||
test_parse_args_rejects_invalid_compression_level_equals();
|
||||
test_parse_args_rejects_invalid_compression_choice();
|
||||
test_parse_args_partial_progress();
|
||||
test_parse_args_checksum_choice_aliases();
|
||||
test_parse_args_checksum_choice_requires_value();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user