diff options
author | Ken Payson <kpayson@google.com> | 2016-08-11 10:09:37 -0700 |
---|---|---|
committer | Ken Payson <kpayson@google.com> | 2016-08-11 10:09:37 -0700 |
commit | a6402a9d43410057100d90b0498371790c6052e4 (patch) | |
tree | 28f68f33375525c0625dbda292750a7e20a3dc18 /test/core | |
parent | 3ed00635f91dad88788b99b2e06d9d7e647fb9d5 (diff) |
Made strings constant
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/census/resource_test.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/core/census/resource_test.c b/test/core/census/resource_test.c index cfe4f037fd..8f5a4387d1 100644 --- a/test/core/census/resource_test.c +++ b/test/core/census/resource_test.c @@ -95,7 +95,7 @@ static void test_define_single_resource(const char *file, const char *name, } // Try deleting various resources (both those that exist and those that don't). -static void test_delete_resource(char* minimal_good, char* full) { +static void test_delete_resource(const char *minimal_good, const char *full) { initialize_resources(); // Try deleting resource before any are defined. census_delete_resource(0); @@ -133,9 +133,9 @@ static void test_base_resources() { } int main(int argc, char **argv) { - char *resource_empty_name_pb, *resource_full_pb, *resource_minimal_good_pb, + const char *resource_empty_name_pb, *resource_full_pb, *resource_minimal_good_pb, *resource_no_name_pb, *resource_no_numerator_pb, *resource_no_unit_pb; - if (argc >= 7) { + if (argc == 7) { resource_empty_name_pb = argv[1]; resource_full_pb = argv[2]; resource_minimal_good_pb = argv[3]; @@ -143,6 +143,7 @@ int main(int argc, char **argv) { resource_no_numerator_pb = argv[5]; resource_no_unit_pb = argv[6]; } else { + GPR_ASSERT(argc == 1); resource_empty_name_pb = "test/core/census/data/resource_empty_name.pb"; resource_full_pb = "test/core/census/data/resource_full.pb"; resource_minimal_good_pb = "test/core/census/data/resource_minimal_good.pb"; |