add cov for mint build

This commit is contained in:
Christian Grothoff 2015-07-05 13:48:35 +02:00
parent a104914e4d
commit ac8420a661
4 changed files with 35 additions and 9 deletions

View File

@ -1,6 +1,11 @@
# This Makefile.am is in the public domain
AM_CPPFLAGS = -I$(top_srcdir)/src/include
if USE_COVERAGE
AM_CFLAGS = --coverage -O0
XLIB = -lgcov
endif
bin_PROGRAMS = \
taler-mint-httpd

View File

@ -1064,6 +1064,23 @@ TMH_PARSE_member_object (const char *field,
}
/**
* Generate line in parser specification for JSON array value.
*
* @param field name of the field
* @param jsonp address of JSON pointer to initialize
* @return corresponding field spec
*/
struct TMH_PARSE_FieldSpecification
TMH_PARSE_member_array (const char *field,
json_t **jsonp)
{
struct TMH_PARSE_FieldSpecification ret =
{ field, jsonp, 0, 0, TMH_PARSE_JNC_RET_TYPED_JSON, JSON_ARRAY };
return ret;
}
/**
* Generate line in parser specification for an absolute time.
*

View File

@ -252,13 +252,17 @@ TMH_PARSE_release_data (struct TMH_PARSE_FieldSpecification *spec);
*/
#define TMH_PARSE_MEMBER_VARIABLE(field) { field, NULL, 0, 0, TMH_PARSE_JNC_RET_DATA_VAR, 0 }
/**
* Generate line in parser specification for JSON array value.
*
* @param field name of the field
* @param ptraddr address of pointer to initialize (a `void **`)
* @param ptraddr address of JSON pointer to initialize
* @return corresponding field spec
*/
#define TMH_PARSE_MEMBER_ARRAY(field,ptraddr) { field, ptraddr, 0, 0, TMH_PARSE_JNC_RET_TYPED_JSON, JSON_ARRAY }
struct TMH_PARSE_FieldSpecification
TMH_PARSE_member_array (const char *field,
json_t **jsonp);
/**

View File

@ -653,12 +653,12 @@ TMH_REFRESH_handler_refresh_melt (struct TMH_RequestHandler *rh,
json_t *coin_detail;
int res;
struct TMH_PARSE_FieldSpecification spec[] = {
TMH_PARSE_MEMBER_ARRAY ("new_denoms", &new_denoms),
TMH_PARSE_MEMBER_ARRAY ("melt_coins", &melt_coins),
TMH_PARSE_MEMBER_ARRAY ("coin_evs", &coin_evs),
TMH_PARSE_MEMBER_ARRAY ("link_encs", &link_encs),
TMH_PARSE_MEMBER_ARRAY ("transfer_pubs", &transfer_pubs),
TMH_PARSE_MEMBER_ARRAY ("secret_encs", &secret_encs),
TMH_PARSE_member_array ("new_denoms", &new_denoms),
TMH_PARSE_member_array ("melt_coins", &melt_coins),
TMH_PARSE_member_array ("coin_evs", &coin_evs),
TMH_PARSE_member_array ("link_encs", &link_encs),
TMH_PARSE_member_array ("transfer_pubs", &transfer_pubs),
TMH_PARSE_member_array ("secret_encs", &secret_encs),
TMH_PARSE_MEMBER_END
};
@ -820,7 +820,7 @@ TMH_REFRESH_handler_refresh_reveal (struct TMH_RequestHandler *rh,
json_t *transfer_privs;
struct TMH_PARSE_FieldSpecification spec[] = {
TMH_PARSE_MEMBER_FIXED ("session_hash", &session_hash),
TMH_PARSE_MEMBER_ARRAY ("transfer_privs", &transfer_privs),
TMH_PARSE_member_array ("transfer_privs", &transfer_privs),
TMH_PARSE_MEMBER_END
};