diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-09-20 13:48:15 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-09-20 13:48:15 +0200 |
commit | a6f8fa98b0253091cae0f2e38fb5fcec47e115fa (patch) | |
tree | c505f31400c14486ad68cdb237decc8fa35ca117 /src/util/test_wireformats.c | |
parent | 1eadd66ae0c4abe6867321bcac0ad2f9832a0baf (diff) | |
download | exchange-a6f8fa98b0253091cae0f2e38fb5fcec47e115fa.tar.gz exchange-a6f8fa98b0253091cae0f2e38fb5fcec47e115fa.tar.bz2 exchange-a6f8fa98b0253091cae0f2e38fb5fcec47e115fa.zip |
implement #3972: support multiple wire formats concurrently
Diffstat (limited to 'src/util/test_wireformats.c')
-rw-r--r-- | src/util/test_wireformats.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/util/test_wireformats.c b/src/util/test_wireformats.c index ebb96604c..e4bd238f7 100644 --- a/src/util/test_wireformats.c +++ b/src/util/test_wireformats.c @@ -15,9 +15,9 @@ */ /** - * @file util/test_json_validations.c + * @file util/test_wireformats.c * @brief Tests for JSON validations - * @author Sree Harsha Totakura <sreeharsha@totakura.in> + * @author Sree Harsha Totakura <sreeharsha@totakura.in> */ #include "platform.h" @@ -65,10 +65,18 @@ static const char * const unsupported_wire_str = \"address\": \"foobar\"}"; -int -main(int argc, +int +main(int argc, const char *const argv[]) { + const char *unsupported[] = { + "unsupported", + NULL + }; + const char *sepa[] = { + "SEPA", + NULL + }; json_t *wire; json_error_t error; int ret; @@ -76,16 +84,16 @@ main(int argc, GNUNET_log_setup ("test-json-validations", "WARNING", NULL); (void) memset(&error, 0, sizeof(error)); GNUNET_assert (NULL != (wire = json_loads (unsupported_wire_str, 0, NULL))); - GNUNET_assert (1 != TALER_json_validate_wireformat ("unsupported", wire)); + GNUNET_assert (1 != TALER_json_validate_wireformat (unsupported, wire)); json_decref (wire); GNUNET_assert (NULL != (wire = json_loads (invalid_wire_str, 0, NULL))); - GNUNET_assert (1 != TALER_json_validate_wireformat ("SEPA", wire)); + GNUNET_assert (1 != TALER_json_validate_wireformat (sepa, wire)); json_decref (wire); GNUNET_assert (NULL != (wire = json_loads (invalid_wire_str2, 0, NULL))); - GNUNET_assert (1 != TALER_json_validate_wireformat ("SEPA", wire)); + GNUNET_assert (1 != TALER_json_validate_wireformat (sepa, wire)); json_decref (wire); GNUNET_assert (NULL != (wire = json_loads (valid_wire_str, 0, &error))); - ret = TALER_json_validate_wireformat ("SEPA", wire); + ret = TALER_json_validate_wireformat (sepa, wire); json_decref (wire); if (1 == ret) return 0; |