+ pbio_t i,j;
+ int cpt;
+ int cpt2;
+ gras_datadesc_type_t *pbio_type;
+
+ INFO0("---- Test on the PBIO IEEE struct (also tests GRAS DEFINE TYPE) ----");
+ pbio_type = gras_datadesc_by_symbol(s_pbio);
+
+ /* Fill in that damn struct */
+ i.Cnstatv = 325115;
+ for (cpt=0; cpt<12; cpt++)
+ i.Cstatev[cpt] = ((double) cpt) * -2361.11;
+ i.Cnprops = -37373;
+ for (cpt=0; cpt<110; cpt++)
+ i.Cprops[cpt] = cpt * 100.0;
+ for (cpt=0; cpt<4; cpt++)
+ i.Cndi[cpt] = cpt * 23262;
+ i.Cnshr = -4634;
+ i.Cnpt = 114142;
+ i.Cdtime = -11515.662;
+ i.Ctime[0] = 332523.226;
+ i.Ctime[1] = -26216.113;
+ i.Cntens = 235211411;
+
+ for (cpt=0; cpt<3; cpt++) {
+ for (cpt2=0; cpt2<373; cpt2++)
+ i.Cdfgrd0[cpt2][cpt] = ((double)cpt) * ((double)cpt2);
+ for (cpt2=0; cpt2<3; cpt2++)
+ i.Cdfgrd1[cpt][cpt2] = -((double)cpt) * ((double)cpt2);
+ }
+ for (cpt=0; cpt<106; cpt++) {
+ i.Cstress[cpt]=(double)cpt * 22.113;
+ for (cpt2=0; cpt2<106; cpt2++)
+ i.Cddsdde[cpt][cpt2] = ((double)cpt) * ((double)cpt2);
+ }
+ TRY(write_read(gras_datadesc_by_symbol(s_pbio),
+ &i,&j, sock,direction));
+ if (direction == READ || direction == RW) {
+ /* Check that the data match */
+ gras_assert(i.Cnstatv == j.Cnstatv);
+ for (cpt=0; cpt<12; cpt++)
+ gras_assert(i.Cstatev[cpt] == j.Cstatev[cpt]);
+ gras_assert(i.Cnprops == j.Cnprops);
+ for (cpt=0; cpt<110; cpt++)
+ gras_assert(i.Cprops[cpt] == j.Cprops[cpt]);
+ for (cpt=0; cpt<4; cpt++)
+ gras_assert(i.Cndi[cpt] == j.Cndi[cpt]);
+ gras_assert(i.Cnshr == j.Cnshr);
+ gras_assert(i.Cnpt == j.Cnpt);
+ gras_assert(i.Cdtime == j.Cdtime);
+ gras_assert(i.Ctime[0] == j.Ctime[0]);
+ gras_assert(i.Ctime[1] == j.Ctime[1]);
+ gras_assert(i.Cntens == j.Cntens);
+ for (cpt=0; cpt<3; cpt++) {
+ for (cpt2=0; cpt2<373; cpt2++)
+ gras_assert(i.Cdfgrd0[cpt2][cpt] == j.Cdfgrd0[cpt2][cpt]);
+ for (cpt2=0; cpt2<3; cpt2++)
+ gras_assert(i.Cdfgrd1[cpt][cpt2] == j.Cdfgrd1[cpt][cpt2]);
+ }
+ for (cpt=0; cpt<106; cpt++) {
+ gras_assert(i.Cstress[cpt] == j.Cstress[cpt]);
+ for (cpt2=0; cpt2<106; cpt2++)
+ gras_assert4(i.Cddsdde[cpt][cpt2] == j.Cddsdde[cpt][cpt2],
+ "%f=i.Cddsdde[%d][%d] != j.Cddsdde[cpt][cpt2]=%f",
+ i.Cddsdde[cpt][cpt2],cpt,cpt2,j.Cddsdde[cpt][cpt2]);
+ }
+ }