|
|
|
@ -39,12 +39,12 @@ |
|
|
|
|
#include <grpc/support/useful.h> |
|
|
|
|
#include "test/core/util/test_config.h" |
|
|
|
|
|
|
|
|
|
#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FUNCTION__) |
|
|
|
|
#define LOG_TEST() gpr_log(GPR_INFO, "%s", __FILE__) |
|
|
|
|
|
|
|
|
|
static void test_simple_int(void) { |
|
|
|
|
int x = 1; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "-foo", "3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "-foo", "3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -59,7 +59,7 @@ static void test_simple_int(void) { |
|
|
|
|
static void test_eq_int(void) { |
|
|
|
|
int x = 1; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "-foo=3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "-foo=3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -74,7 +74,7 @@ static void test_eq_int(void) { |
|
|
|
|
static void test_2dash_int(void) { |
|
|
|
|
int x = 1; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo", "3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo", "3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ static void test_2dash_int(void) { |
|
|
|
|
static void test_2dash_eq_int(void) { |
|
|
|
|
int x = 1; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo=3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo=3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -104,7 +104,7 @@ static void test_2dash_eq_int(void) { |
|
|
|
|
static void test_simple_string(void) { |
|
|
|
|
char *x = NULL; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "-foo", "3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "-foo", "3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -119,7 +119,7 @@ static void test_simple_string(void) { |
|
|
|
|
static void test_eq_string(void) { |
|
|
|
|
char *x = NULL; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "-foo=3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "-foo=3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -134,7 +134,7 @@ static void test_eq_string(void) { |
|
|
|
|
static void test_2dash_string(void) { |
|
|
|
|
char *x = NULL; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo", "3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo", "3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -149,7 +149,7 @@ static void test_2dash_string(void) { |
|
|
|
|
static void test_2dash_eq_string(void) { |
|
|
|
|
char *x = NULL; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo=3"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo=3"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -164,7 +164,7 @@ static void test_2dash_eq_string(void) { |
|
|
|
|
static void test_flag_on(void) { |
|
|
|
|
int x = 2; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -179,7 +179,7 @@ static void test_flag_on(void) { |
|
|
|
|
static void test_flag_no(void) { |
|
|
|
|
int x = 2; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--no-foo"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--no-foo"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -194,7 +194,7 @@ static void test_flag_no(void) { |
|
|
|
|
static void test_flag_val_1(void) { |
|
|
|
|
int x = 2; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo=1"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo=1"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -209,7 +209,7 @@ static void test_flag_val_1(void) { |
|
|
|
|
static void test_flag_val_0(void) { |
|
|
|
|
int x = 2; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo=0"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo=0"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -224,7 +224,7 @@ static void test_flag_val_0(void) { |
|
|
|
|
static void test_flag_val_true(void) { |
|
|
|
|
int x = 2; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo=true"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo=true"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -239,7 +239,7 @@ static void test_flag_val_true(void) { |
|
|
|
|
static void test_flag_val_false(void) { |
|
|
|
|
int x = 2; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--foo=false"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--foo=false"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
@ -257,7 +257,7 @@ static void test_many(void) { |
|
|
|
|
int flag = 2; |
|
|
|
|
gpr_cmdline *cl; |
|
|
|
|
|
|
|
|
|
char *args[] = {(char *)__FUNCTION__, "--str", "hello", "-x=4", "-no-flag"}; |
|
|
|
|
char *args[] = {(char *)__FILE__, "--str", "hello", "-x=4", "-no-flag"}; |
|
|
|
|
|
|
|
|
|
LOG_TEST(); |
|
|
|
|
|
|
|
|
|