/******************************************************************************
 * Copyright (c) 2000-2025 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   Balasko, Jeno
 *   Raduly, Csaba
 *
 ******************************************************************************/
/*
//AUTHOR: ezolmed 
//DATE: 2012-10-08
//VERSION: 
*/
module Test {
  import from Module all;

  type component Test_CT{};
  
  
  testcase tc_01() runs on Test_CT{
    var PDU vl_pdu := {
      msg_type := '01'O,
      u := {
        h1 := 'A'H
      }
    }
    
    var octetstring vl_encoded := enc_PDU(vl_pdu);
    var PDU vl_decoded := dec_PDU(vl_encoded);
    
    if(vl_pdu == vl_decoded){
      setverdict(pass);  
    } else {
      setverdict(fail,  match(vl_decoded, vl_pdu));
    }
    
  }
  
  testcase tc_02() runs on Test_CT{
    var PDU vl_pdu := {
      msg_type := '03'O,
      u := {
        my_type := {
          id := '01'O,
          spare := 'F'H,
          hex := '99999'H,
          o := '123456'O
        }
      }
    }
    
    var octetstring vl_encoded := enc_PDU(vl_pdu);
    var PDU vl_decoded := dec_PDU(vl_encoded);
    
    if(vl_pdu == vl_decoded){
      setverdict(pass);  
    } else {
      setverdict(fail, match(vl_decoded, vl_pdu));
    }
  }
  
  testcase tc_05() runs on Test_CT{
    var PDU vl_pdu := {
      msg_type := '02'O,
      u := {
        h5 := '535AF'H
      }
    }
    
    var octetstring vl_encoded := enc_PDU(vl_pdu);
    var PDU vl_decoded := dec_PDU(vl_encoded);
    
    if(vl_pdu == vl_decoded){
      setverdict(pass);  
    } else {
      setverdict(fail, match(vl_decoded, vl_pdu));
    }
  }
  
  
  
  control{
    execute(tc_01());
    execute(tc_02());
    execute(tc_05());
    //execute(tc_03());
  }
  
}  // end of module
