Debian Codegraph @

test/test.c

raw symbols SCIP
1 #cxx . . $ `<file>/test/test.c`/include <stdbool.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4
5 #include <xeddsa.h>cxx . . $ `<file>/include/xeddsa.h`/
6
7 #include <test.h>cxx . . $ `<file>/test/test.h`/
8
9 static void checkcxx . . $ check(82f9cc8f24becb80).(int result, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`!* failed, const char* name) {
10 if (result == 0) {
11 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!, "Test passed: %s\n", name);
12 }
13 else {
14 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Test failed: %s\n", name);
15 *failed = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
16 }
17 }
18
19 int maincxx . . $ main(d1b40a211a1a4e4c).() {
20 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! failed = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
21
22 if (xeddsa_initcxx . . $ xeddsa_init(d1b40a211a1a4e4c).() < 0) {
23 fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "Couldn't initialize the library.\n");
24 return EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`!;
25 }
26
27 checkcxx . . $ check(82f9cc8f24becb80).(test_signingcxx . . $ test_signing(d1b40a211a1a4e4c).(), &failed, "private key/seed-based signing");
28 checkcxx . . $ check(82f9cc8f24becb80).(test_conversion_uniquenesscxx . . $ test_conversion_uniqueness(d1b40a211a1a4e4c).(), &failed, "public key conversion uniqueness");
29 checkcxx . . $ check(82f9cc8f24becb80).(test_pub_derivationcxx . . $ test_pub_derivation(d1b40a211a1a4e4c).(), &failed, "public key from private key/seed derivation");
30
31 return failed ? EXIT_FAILUREcxx . . $ `<external>/10696550936717951914/stdlib.h:92:9`! : EXIT_SUCCESScxx . . $ `<external>/10696550936717951914/stdlib.h:93:9`!;
32 }