Skip to content

Commit

Permalink
added missing test files
Browse files Browse the repository at this point in the history
  • Loading branch information
jaromil committed Sep 17, 2024
1 parent 1adfe73 commit 87cc5a5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/api_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int print_buf_hex(const uint8_t *in, const size_t len) {
// REMEMBER TO FREE THE OUTPUT AFTER USE
static char* hex2buf_alloc(const char *name, const char *hex, size_t *size) {
// check that size is desired
const size_t hexlen = strlen(hex) / 2;
const size_t hexlen = strlen(hex) >>1;
char *out = NULL;
if(*size>0 && *size!=hexlen) {
_err("api_sign %s :: wrong size, found %u instead of %u",name,hexlen,*size);
Expand Down
10 changes: 10 additions & 0 deletions test/api/sign_create.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <zenroom.h>

int main(int argc, char **argv) {
int res;
res = zenroom_sign_create(argv[1], argv[2], argv[3]);
if(res!=0){fprintf(stderr,"Abort on error code %u\n",res);exit(res);}
exit(0);
}
10 changes: 10 additions & 0 deletions test/api/sign_verify.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <zenroom.h>

int main(int argc, char **argv) {
int res;
res = zenroom_sign_verify(argv[1], argv[2], argv[3], argv[4]);
if(res!=0){fprintf(stderr,"Abort on error code %u\n",res);exit(res);}
exit(0);
}

0 comments on commit 87cc5a5

Please sign in to comment.