/****************************************************************************** * Copyright (c) 2000-2016 Ericsson Telecom AB * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Adrien Kirjak – initial implementation * ** @version 0.0.1 ** @purpose 1:16.1.2, Ensure that predefined encvalue function works correctly (as specified in Annex C.5.1) ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ // The following requirements are tested: // (C.5.1) The encvalue function encodes a value or template into a bitstring. When the actual // parameter that is passed to inpar is a template, it shall resolve to a specific value (the // same restrictions apply as for the argument of the send statement). The returned bitstring // represents the encoded value of inpar, however, the TTCN-3 test system need not make any // check on its correctness. module Sem_160102_predefined_functions_016 { type integer I with { variant "32 bit"}; type component GeneralComp { } testcase TC_Sem_160102_predefined_functions_016 () runs on GeneralComp { var template I v_test := 0; var bitstring v_res := encvalue(v_test); if (lengthof(v_res) == 32) { setverdict(pass); } else { setverdict(fail, "Invalid encoding length"); } } control{ execute(TC_Sem_160102_predefined_functions_016()); } }