/*****************************************************************/
/**                                                             **/
/**             (C) Copyright 1992 the Regents of the           **/
/**        University of California.  All Rights Reserved.      **/
/**                                                             **/
/**        This work was produced under the sponsorship of      **/
/**         the U.S. Department of Energy.  The Government      **/
/**                retains certain rights therein.              **/
/**                                                             **/
/**                         Written by                          **/
/**         Distributed Programming Environments Project        **/
/**           Computer Software and Networking Division,        **/
/**                   Livermore Computer Center,                **/
/**            Lawrence Livermore National Laboratory           **/
/**                                                             **/
/*****************************************************************/

Interface sample;

   Array Integer(2) arrtype[10];

   Invoke arrayop 52 
      arrtype;

End;


main(argc,argv)
   int argc;
   char *argv[];
{
   arrtype arr_s, arr_r;
   Data (sample) inst;
   int size1 = 0;
   int size2 = 0;

   if (argc != 2)
      exit(1);   


/***************** send it out ************************/

   Bind_STUB(inst,argv[1],"w",Asn_1_ber);
   Give inst
   {
      arrayop(arr_s{size1});
   }
   Give inst
   {
      arrayop();
   }
   Unbind(inst);

/***************** receive it back ********************/

   size1 = 10;
   size2 = 10;
   Bind_STUB(inst,argv[1],"r",Asn_1_ber);
   Accept inst
      {
	 On arrayop(arr_r{size1});
      }
   Accept inst
      {
	 On arrayop(arr_r{size2});
      }
   Unbind(inst);

/***************** report results *********************/

   if (size1 != 0) {
      printf("size1 is %d (should be 0)\n",size1);
      exit(1);
   }
   if (size2 != 0) {
      printf("size2 is %d (should be 0)\n",size2);
      exit(1);
   }

   printf("test completed\n");
   return(0);
}
