Use ARRAY_LEN() macro in tests
This commit is contained in:
parent
929bf48c7e
commit
419c869c9c
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "cli.h"
|
#include "cli.h"
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
static void test_flag_version(void) {
|
static void test_flag_version(void) {
|
||||||
struct scrcpy_cli_args args = {
|
struct scrcpy_cli_args args = {
|
||||||
|
@ -66,7 +67,7 @@ static void test_options(void) {
|
||||||
"--window-borderless",
|
"--window-borderless",
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ok = scrcpy_parse_args(&args, sizeof(argv) / sizeof(*argv), argv);
|
bool ok = scrcpy_parse_args(&args, ARRAY_LEN(argv), argv);
|
||||||
assert(ok);
|
assert(ok);
|
||||||
|
|
||||||
const struct scrcpy_options *opts = &args.opts;
|
const struct scrcpy_options *opts = &args.opts;
|
||||||
|
@ -108,7 +109,7 @@ static void test_options2(void) {
|
||||||
"--record", "file.mp4", // cannot enable --no-display without recording
|
"--record", "file.mp4", // cannot enable --no-display without recording
|
||||||
};
|
};
|
||||||
|
|
||||||
bool ok = scrcpy_parse_args(&args, sizeof(argv) / sizeof(*argv), argv);
|
bool ok = scrcpy_parse_args(&args, ARRAY_LEN(argv), argv);
|
||||||
assert(ok);
|
assert(ok);
|
||||||
|
|
||||||
const struct scrcpy_options *opts = &args.opts;
|
const struct scrcpy_options *opts = &args.opts;
|
||||||
|
|
Loading…
Reference in a new issue