mirror of
https://github.com/tailix/libkernaux.git
synced 2025-04-07 17:32:45 -04:00
Add more tests for command line parser
This commit is contained in:
parent
5ad5a1300b
commit
0830f09a80
1 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <kernaux/cmdline.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
static const unsigned int ARGV_COUNT_MAX = 1024;
|
||||
static const unsigned int ARG_SIZE_MAX = 4096;
|
||||
|
@ -8,7 +9,7 @@ static const unsigned int ARG_SIZE_MAX = 4096;
|
|||
int main()
|
||||
{
|
||||
char error_msg[KERNAUX_CMDLINE_ERROR_MSG_SIZE_MAX];
|
||||
unsigned int argc;
|
||||
unsigned int argc = 1234;
|
||||
char *argv[ARGV_COUNT_MAX];
|
||||
char buffer[ARGV_COUNT_MAX * ARG_SIZE_MAX];
|
||||
|
||||
|
@ -22,5 +23,12 @@ int main()
|
|||
ARG_SIZE_MAX
|
||||
));
|
||||
|
||||
assert(strcmp(error_msg, "") == 0);
|
||||
assert(argc == 0);
|
||||
|
||||
for (unsigned int index = 0; index < ARGV_COUNT_MAX; ++index) {
|
||||
assert(argv[index] == KERNAUX_NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue