/******************************************************************************
 * Copyright (c) ETSI 2017.
 *
 * This file is subject to copyrights owned by ETSI. Non-exclusive permission
 * is hereby granted, free of charge, to copy, reproduce and amend this file
 * under the following conditions: It is provided "as is", without warranty of any
 * kind, expressed or implied.
 * 
 * ETSI shall never be liable for any claim, damages, or other liability arising
 * from its use or inability of use.This permission does not apply to any documentation
 * associated with this file for which ETSI keeps all rights reserved. The present
 * copyright notice shall be included in all copies of whole or part of this
 * file and shall not imply any sub-license right.
 *
 * Modified by: Adrien Kirjak
 *
 ** @version  0.0.1
 ** @purpose  1:19.3.2, verify that the same alternative cannot be used in two case statements (list item)
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// No two cases in a select union statement shall have the same case Identifier.

module NegSem_190302_select_union_statement_005 { 

    type component GeneralComp {
	}	
    
    type union U {
        integer intOption,
        charstring strOption,
        record {
            integer field1,
            integer field2
        } recOption
    }

    testcase TC_NegSem_190302_select_union_statement_005() runs on GeneralComp {
        var U v_un := { intOption := 10 }
        select union (v_un) {
            case (intOption, strOption) {
                setverdict(pass);
            } case (recOption, intOption) {
                setverdict(fail);
            }
        }
	}

	control {
		execute(TC_NegSem_190302_select_union_statement_005());
	}
}
