some fixes

This commit is contained in:
2022-04-18 13:50:33 +03:00
parent 354e6abaea
commit 1d7beebf6c
5 changed files with 62 additions and 23 deletions

View File

@@ -30,6 +30,10 @@ void print_dtsod(Hashtable* dtsod){
}));
}
#include <errno.h>
void test_dtsod(){
optime(__func__,1,({
printf("\e[96m-------------[test_dtsod]-------------\n");
@@ -59,5 +63,26 @@ void test_dtsod(){
}));
free(s);
FILE* f=fopen("messages.dtsod", "r");
printf("f: %p\n", f);
if(f==NULL){
perror("error ");
throw("can't open file");
}
char fbuf[65535];
uint32 i=0;
char cc;
while((cc=fgetc(f))!=EOF){
fbuf[i++]=cc;
}
fbuf[i]='\0';
printf("read %u chars", i);
Maybe rrr=DtsodV24_deserialize(fbuf);
if(rrr.errmsg) {
throw(rrr.errmsg);
}
else dtsod=rrr.value.VoidPtr;
Hashtable_free(dtsod);
}));
}