vere compiles

This commit is contained in:
Ted Blackman 2022-05-26 11:16:46 -05:00
parent a1f202deb0
commit 086f563f90
2 changed files with 389 additions and 403 deletions

View File

@ -25,7 +25,6 @@
} u3_prel;
typedef struct _u3_body {
u3_prel pre_u; // prelude
c3_s con_s; // content size
c3_y* con_y; // content
c3_l mug_l; // checksum
@ -61,51 +60,52 @@ _test_ames(void)
}
}
static void
_test_sift_etch()
{
u3_head* hed_u = c3_calloc(sizeof(*hed_u));
u3_body* bod_u = c3_calloc(sizeof(*bod_u));
hed_u->sim_o = c3y;
hed_u->ver_y = 1;
hed_u->sac_y = 4;
hed_u->rac_y = 4;
hed_u->rel_o = c3n;
bod_u->pre_u.sen_d[0] = 0;
bod_u->pre_u.sen_d[1] = 0;
bod_u->pre_u.rec_d[0] = 182;
bod_u->pre_u.rec_d[1] = 0;
c3_y* str = (c3_y*)"test";
bod_u->con_y = str;
bod_u->con_s = 5;
c3_y** out_y;
c3_w pac_w = _ames_etch_pack(hed_u, bod_u, out_y);
u3_head* nhed_u = c3_calloc(sizeof(*nhed_u));
u3_body* nbod_u = c3_calloc(sizeof(*nbod_u));
_ames_sift_head(nhed_u, *out_y);
*out_y += 4;
c3_y_ames_sift_body(nbod_u, *out_y);
if( 0 != memcmp(hed_u, nhed_u, sizeof(*hed_u))) {
fprintf(stderr, "ames: header serialisation mismatch(a)\r\n");
exit(1);
}
if( 0 != memcmp(bod_u, nbod_u, sizeof(*bod_u))) {
fprintf(stderr, "ames: body serialisation fail(a)\r\n");
exit(1);
} else {
fprintf(stderr, "ames: pass (a)\r\n");
exit(1);
}
}
//TODO: rewrite with more types: purr, wail, body,etc.
//static void
//_test_sift_etch()
//{
// u3_head* hed_u = c3_calloc(sizeof(*hed_u));
// u3_body* bod_u = c3_calloc(sizeof(*bod_u));
//
// hed_u->sim_o = c3y;
// hed_u->ver_y = 1;
// hed_u->sac_y = 4;
// hed_u->rac_y = 4;
// hed_u->rel_o = c3n;
//
// bod_u->pre_u.sen_d[0] = 0;
// bod_u->pre_u.sen_d[1] = 0;
// bod_u->pre_u.rec_d[0] = 182;
// bod_u->pre_u.rec_d[1] = 0;
//
// c3_y* str = (c3_y*)"test";
//
// bod_u->con_y = str;
// bod_u->con_s = 5;
//
// c3_y** out_y;
//
// c3_w pac_w = _ames_etch_pack(hed_u, bod_u, out_y);
//
// u3_head* nhed_u = c3_calloc(sizeof(*nhed_u));
// u3_body* nbod_u = c3_calloc(sizeof(*nbod_u));
// _ames_sift_head(nhed_u, *out_y);
// *out_y += 4;
// c3_y_ames_sift_body(nbod_u, *out_y);
//
// if( 0 != memcmp(hed_u, nhed_u, sizeof(*hed_u))) {
// fprintf(stderr, "ames: header serialisation mismatch(a)\r\n");
// exit(1);
// }
// if( 0 != memcmp(bod_u, nbod_u, sizeof(*bod_u))) {
// fprintf(stderr, "ames: body serialisation fail(a)\r\n");
// exit(1);
// } else {
// fprintf(stderr, "ames: pass (a)\r\n");
// exit(1);
// }
//
//}
/* main(): run all test cases.
*/
int

File diff suppressed because it is too large Load Diff