diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-22 03:13:10 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-22 03:13:10 -0400 |
commit | 697f522c79adc9551b90063b3d2939bcf2cfc7ac (patch) | |
tree | 9154fd080f1885ef1ee57169b8667ece734da2e8 /src/include/taler_testing_lib.h | |
parent | ffc3f20daadce9ffaf50969ba9b9a04c2c22b75d (diff) |
testing traits for uint32_t and GNUNET_TIME_Relative
Diffstat (limited to 'src/include/taler_testing_lib.h')
-rw-r--r-- | src/include/taler_testing_lib.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 8274555c..245ce494 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -2324,6 +2324,31 @@ TALER_TESTING_make_trait_denom_sig ( /** + * Offer number trait, 32-bit version. + * + * @param index the number's index number. + * @param n number to offer. + */ +struct TALER_TESTING_Trait +TALER_TESTING_make_trait_uint32 (unsigned int index, + const uint32_t *n); + + +/** + * Obtain a "number" value from @a cmd, 32-bit version. + * + * @param cmd command to extract the number from. + * @param index the number's index number. + * @param[out] n set to the number coming from @a cmd. + * @return #GNUNET_OK on success. + */ +int +TALER_TESTING_get_trait_uint32 (const struct TALER_TESTING_Command *cmd, + unsigned int index, + const uint32_t **n); + + +/** * Offer number trait, 64-bit version. * * @param index the number's index number. @@ -2838,4 +2863,33 @@ TALER_TESTING_make_trait_absolute_time ( unsigned int index, const struct GNUNET_TIME_Absolute *time); + +/** + * Obtain a relative time from @a cmd. + * + * @param cmd command to extract trait from + * @param index which time to pick if + * @a cmd has multiple on offer. + * @param[out] time set to the wanted WTID. + * @return #GNUNET_OK on success + */ +int +TALER_TESTING_get_trait_relative_time ( + const struct TALER_TESTING_Command *cmd, + unsigned int index, + const struct GNUNET_TIME_Relative **time); + + +/** + * Offer a relative time. + * + * @param index associate the object with this index + * @param time which object should be returned + * @return the trait. + */ +struct TALER_TESTING_Trait +TALER_TESTING_make_trait_relative_time ( + unsigned int index, + const struct GNUNET_TIME_Relative *time); + #endif |