Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve tests 2 #37

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion COGNAC
Submodule COGNAC updated 1 files
+2 −2 main_tpl.c
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int argcmp(const char *s1, const char *s2)

static void files_cnt_cleanup(char * (*files_cnt_ptr)[64])
{
for (int i = 0; i < MAX_FILES_PER_CMD && *files_cnt_ptr[i]; ++i) {
for (int i = 0; i < MAX_FILES_PER_CMD && (*files_cnt_ptr)[i]; ++i) {
free((*files_cnt_ptr)[i]);
}
}
Expand All @@ -92,7 +92,7 @@ char *read_file(char *files_cnt[static MAX_FILES_PER_CMD], char *file_name)
{
int dest = -1;
for (int i = 0; i < MAX_FILES_PER_CMD; ++i) {
if (!file_name[i]) {
if (!files_cnt[i]) {
dest = i;
break;
}
Expand Down
11 changes: 8 additions & 3 deletions tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ trap "echo [$MSG_BASE Lot of Arguments FAIL]" ERR
./tests-lot-arg.sh | grep RequestId > /dev/null
echo "[$MSG_BASE Lot of Arguments OK]"

trap "echo [$MSG_BASE ReadConsumptionAccount --FromDate $(date --date="-5 days" '+%F') --ToDate $(date --date="-1 days" "+%F") FAIL]" ERR
./oapi-cli ReadConsumptionAccount --FromDate $(date --date="-5 days" '+%F') --ToDate $(date --date="-1 days" "+%F") | grep Operation > /dev/null
echo "[$MSG_BASE ReadConsumptionAccount --FromDate $(date --date="-5 days" '+%F') --ToDate $(date --date="-1 days" "+%F") OK]"
trap "echo [$MSG_BASE ReadVms --DryRun --file false.txt FAIL]" ERR
echo -n false > false.txt
./oapi-cli ReadVms --DryRun --file false.txt | grep RequestId > /dev/null
echo "[$MSG_BASE ReadVms --DryRun --file false.txt OK]"

trap "echo [$MSG_BASE ReadConsumptionAccount --FromDate $(date --date="-39 days" '+%F') --ToDate $(date --date="-38 days" "+%F") FAIL]" ERR
./oapi-cli ReadConsumptionAccount --FromDate $(date --date="-39 days" '+%F') --ToDate $(date --date="-38 days" "+%F") | grep Operation > /dev/null
echo "[$MSG_BASE ReadConsumptionAccount --FromDate $(date --date="-39 days" '+%F') --ToDate $(date --date="-38 days" "+%F") OK]"
Loading