/*****************************************************************/
/**                                                             **/
/**             (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; 
 
   Invoke op0  1.39.6.3		Integer(4); 
   Error  op1  2.2.8.655	Integer(4); 
   Result op2  2.55.8.655.17	Integer(4); 
   Invoke op3  2.55.8.655.17.8	Integer(4); 
   Error  op4  2.67.8.655.18.1	Integer(4); 
   Result op5  2.55.6.655.4	Integer(4); 
   Invoke op6  2.55.7.655.4	Integer(4); 
   Error  op7  2.55.8.655.99	Integer(4); 
   Result op8  2.55.8.655.9	Integer(4); 
   Invoke op9  2.55.7.654.8	Integer(4); 
   Error  op10 0.39.7.654.5	Integer(4); 
   Result op11; 
 
End; 
  

main(argc,argv) 
   int argc; 
   char *argv[]; 
{ 
   Integer(4) x; 
 
   Control (sample) inst; 
  
   int i; 
 
   if (argc != 2) 
      exit(1);    
  
/***************** send it out ************************/

   Bind_STUB(inst,argv[1],"w",Asn_1_ber); 
   Give inst 
   { 
      op0[0](0); 
      op1[1](1); 
      op2[2](2); 
      op3[3](3); 
      op4[4](4); 
      op5[5](5); 
      op6[6](6); 
      op7[7](7); 
      op8[8](8); 
      op9[9](9); 
      op10[10](10); 
      op11[11](); 
   } 
   Unbind(inst); 
 
/***************** receive it back ********************/

   Bind_STUB(inst,argv[1],"r",Asn_1_ber); 
 
   for (i=0;i<=11;i++) { 
  
   Accept inst 
   { 
      On op0(x) 
        if (i != 0 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op1(x) 
        if (i != 1 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op2(x) 
        if (i != 2 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op3(x) 
        if (i != 3 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op4(x) 
        if (i != 4 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op5(x) 
        if (i != 5 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op6(x) 
        if (i != 6 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op7(x) 
        if (i != 7 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op8(x) 
        if (i != 8 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op9(x) 
        if (i != 9 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op10(x) 
        if (i != 10 || x != i) 
	   printf("###wrong operation %d %d\n",i,x); 
        
      On op11() 
        if (i != 11) 
	   printf("###wrong operation %d %d\n",i,x); 
   } 

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