Mercurial > hg > GearsTemplate
changeset 330:a258505bf9fd examples_directory
Add assert calc examples
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Apr 2017 18:58:16 +0900 |
parents | 8592a1d161b7 |
children | 69cdda536487 7741ef367e24 |
files | src/parallel_execution/examples/calc.cbc |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/examples/calc.cbc Tue Apr 18 06:04:22 2017 +0900 +++ b/src/parallel_execution/examples/calc.cbc Tue Apr 18 18:58:16 2017 +0900 @@ -2,6 +2,7 @@ #include <string.h> #include <stdlib.h> #include <unistd.h> +#include <assert.h> #include "../../context.h" @@ -212,6 +213,7 @@ __code mult(struct Integer* input1, struct Integer* input2, struct Integer* output) { output->value = input1->value * input2->value; printf("%d * %d = %d\n", input1->value, input2->value, output->value); + assert(output->value == 2 * (input2->value * input2->value) + input2->value); goto meta(context, context->next); }