Commit 2e1446f93639d3b619a5b17cdcc44bbd63ca0c7e

Steffen Jaeckel 2016-06-02T09:52:42

Add testcase for mp_add_d('0',...) This closes #65

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/demo/demo.c b/demo/demo.c
index c3990a0..4b871cd 100644
--- a/demo/demo.c
+++ b/demo/demo.c
@@ -222,6 +222,12 @@ int main(void)
    if (mp_get_int(&a) != 1) {
       return EXIT_FAILURE;
    }
+   mp_zero(&a);
+   // a: 0-> a: 6
+   mp_add_d(&a, 6, &a);
+   if (mp_get_int(&a) != 6) {
+      return EXIT_FAILURE;
+   }
 
 
    mp_set_int(&a, 0);