ddat interop with dat js cable interop with cabal js ddat's frontend = dat-thang cable fe = cable-thang dillo support based on cel's dillo-dat bootstrap node xplatform support Signed-off-by: divo <418@cryspace.space>
5 lines
594 B
C
5 lines
594 B
C
#include "sleep_bitfield.h"
|
|
#include <assert.h>
|
|
#include <string.h>
|
|
int main(void){sleep_bitfield_t a,b;unsigned char encoded[sizeof(a)];sleep_bitfield_clear(&a);assert(sizeof(a)==3584);assert(sleep_bitfield_set_data(&a,0,1)==0);assert(sleep_bitfield_set_data(&a,9,1)==0);assert(a.data[0]==0x80&&a.data[1]==0x40);assert(sleep_bitfield_get_data(&a,9)==1);assert(sleep_bitfield_set_tree(&a,3,1)==0);assert(sleep_bitfield_encode(&a,encoded,sizeof(encoded))==0);memset(&b,0,sizeof(b));assert(sleep_bitfield_decode(&b,encoded,sizeof(encoded))==0);assert(sleep_bitfield_get_tree(&b,3)==1);return 0;}
|