Skip to content

Commit

Permalink
No longer have ged_ls, not validating argv[0]
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Nov 22, 2024
1 parent 0671df2 commit 31d7c8b
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions src/libged/tests/plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,33 +390,13 @@ main(int ac, char *av[]) {
wav[1] = NULL;
int ret = ged_exec(gbp, 1, (const char **)wav);
if (ret & GED_UNKNOWN && wav[0] != wav0) {
bu_log("\nged_ls called with command name \"%s\" correctly returned with GED_UNKNOWN set\n", wav0);
bu_log("\nged_exec called with command name \"%s\" correctly returned with GED_UNKNOWN set\n", wav0);
} else {
if (!(ret & GED_UNKNOWN)) {
bu_log("\nged_ls called with command name \"%s\" did not return with GED_UNKNOWN set\n", wav0);
bu_log("\nged_exec called with command name \"%s\" did not return with GED_UNKNOWN set\n", wav0);
}
if (wav[0] == wav0) {
bu_log("\nged_ls called with command name \"%s\" did not override wav[0]\n", wav0);
}
}
}

/* Deliberately call a ged function with wrong argv[0] (which is a valid
* command, just not one matching the function) */
{
const char *wav1 = "search";
const char *wav[2];
wav[0] = wav1;
wav[1] = NULL;
int ret = ged_exec(gbp, 1, (const char **)wav);
if (ret & GED_UNKNOWN && wav[0] != wav1) {
bu_log("\nged_ls called with command name \"%s\" correctly returned with GED_UNKNOWN set\n", wav1);
} else {
if (!(ret & GED_UNKNOWN)) {
bu_log("\nged_ls called with command name \"%s\" did not return with GED_UNKNOWN set\n", wav1);
}
if (wav[0] == wav1) {
bu_log("\nged_ls called with command name \"%s\" did not override wav[0]\n", wav1);
bu_log("\nged_exec called with command name \"%s\" did not override wav[0]\n", wav0);
}
}
}
Expand Down

0 comments on commit 31d7c8b

Please sign in to comment.