/******************************************************************************
 * Copyright (c) 2000-2021 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:
 *   Szabo, Bence Janos
 *
 ******************************************************************************/

module IndexWithRecofArray {

	type component GeneralComp {	    	    
	}
 

	type record of integer RoI;
	type set of integer SoI;
	type record of record of integer RoRoI;
	type record of record of RoRoI RoIRoIRoIRoI;
	type set of set of integer SoISoI;
	type set of set of SoISoI SoISoISoISoI
	type record length(1) of  integer  RoI1;
	type record length(2) of  integer  RoI2;
	type integer IntArr1[1];
	type integer IntArr2[2];


//###########################################################################//
// Record of indexed with array or record of
	
	testcase tc_recordof_indexed_with_array() runs on GeneralComp {

		var RoRoI v_rec := {{0, 1}, {2, 3}};
        var integer v_index[1] := { 1 }

////////////////////////////////////////////////////

		if (v_rec[v_index] == {2, 3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index] := {5, 6};
		if (v_rec[v_index] == {5, 6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index] := {2, 3};

////////////////////////////////////////////////////


		if (v_rec[v_index][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index][0] := 99;
		if (v_rec[v_index][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index][0] := 2;

////////////////////////////////////////////////////

		if (v_rec[0][v_index] == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[0][v_index] := 99;
		if (v_rec[0][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[0][v_index] := 1;


////////////////////////////////////////////////////


		if (v_rec[v_index][v_index] == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index][v_index] := 99;
		if (v_rec[v_index][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index][v_index] := 3;

////////////////////////////////////////////////////		

        var integer v_index2[2] := {1, 0};
        if (v_rec[v_index2] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index2] := 99;
		if (v_rec[v_index2] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index2] := 2;
	}

	testcase tc_recordof_indexed_with_recordof() runs on GeneralComp {

		var RoRoI v_rec := {{0, 1}, {2, 3}};
        var RoI1 v_index := { 1 }
		////////////////////////////////////////////////////

		if (v_rec[v_index] == {2, 3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index] := {5, 6};
		if (v_rec[v_index] == {5, 6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index] := {2, 3};

////////////////////////////////////////////////////


		if (v_rec[v_index][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index][0] := 99;
		if (v_rec[v_index][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index][0] := 2;

////////////////////////////////////////////////////

		if (v_rec[0][v_index] == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[0][v_index] := 99;
		if (v_rec[0][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[0][v_index] := 1;


////////////////////////////////////////////////////


		if (v_rec[v_index][v_index] == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index][v_index] := 99;
		if (v_rec[v_index][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index][v_index] := 3;

////////////////////////////////////////////////////		

        var integer v_index2[2] := {1, 0};
        if (v_rec[v_index2] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index2] := 99;
		if (v_rec[v_index2] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index2] := 2;
	}

	testcase tc_recordof_indexed_with_recordof_and_array() runs on GeneralComp {
		var RoIRoIRoIRoI v_rec := {
			{
				{
					{0, 1},
					{2, 3}
				},
				{
					{4, 5},
					{6, 7}
				}
			},
			{
				{
					{8, 9},
					{10, 11}
				},
				{
					{12, 13},
					{14, 15}
				}
			}
		}
		var integer v_index[1] := {0};
		var integer v_index2[2] := {0, 1};
		var RoI1 v_roi1 := {0};
		var RoI2 v_roi2 := {0, 1};

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[v_index][v_index2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index][v_index2][v_index] := 99;
		if (v_rec[v_index][v_index2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index][v_index2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[v_index][v_index2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index][v_index2][0] := 99;
		if (v_rec[v_index][v_index2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index][v_index2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[v_index][0][1][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_index][0][1][v_index] := 99;
		if (v_rec[v_index][0][1][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_index][0][1][v_index] := 2;

////////////////////////////////////////////////////

		// [0][0][1][0]
		if (v_rec[v_roi1][v_index2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][v_index2][v_index] := 99;
		if (v_rec[v_roi1][v_index2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][v_index2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[v_roi1][v_roi2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][v_roi2][v_index] := 99;
		if (v_rec[v_roi1][v_roi2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][v_roi2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[v_roi1][v_roi2][v_roi1] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][v_roi2][v_roi1] := 99;
		if (v_rec[v_roi1][v_roi2][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][v_roi2][v_roi1] := 2;


////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[v_roi1][v_roi2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][v_roi2][0] := 99;
		if (v_rec[v_roi1][v_roi2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][v_roi2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[0][v_roi2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[0][v_roi2][0] := 99;
		if (v_rec[0][v_roi2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[0][v_roi2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_rec[v_roi1][0][1][v_roi1] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][0][1][v_roi1] := 99;
		if (v_rec[v_roi1][0][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][0][1][v_roi1] := 2;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_rec[v_roi1][1][1][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][1][1][v_roi1] := 99;
		if (v_rec[v_roi1][1][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][1][1][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_rec[v_roi1][v_roi2[1]][1][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][v_roi2[1]][1][v_roi1] := 99;
		if (v_rec[v_roi1][v_roi2[1]][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][v_roi2[1]][1][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_rec[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] := 99;
		if (v_rec[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [1][0][1][1]
		if (v_rec[v_roi2[1]][v_index2][v_index2[1]] == 11) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_rec[v_roi2[1]][v_index2][v_index2[1]] := 99;
		if (v_rec[v_roi2[1]][v_index2][v_index2[1]] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_rec[v_roi2[1]][v_index2][v_index2[1]] := 11;
	}


//###########################################################################//
// Set of indexed with array or record of


	testcase tc_setof_indexed_with_array() runs on GeneralComp {

		var SoISoI v_set := {{0, 1}, {2, 3}};
        var integer v_index[1] := { 1 }
////////////////////////////////////////////////////

		if (v_set[v_index] == {2, 3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index] := {5, 6};
		if (v_set[v_index] == {5, 6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index] := {2, 3};

////////////////////////////////////////////////////


		if (v_set[v_index][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index][0] := 99;
		if (v_set[v_index][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index][0] := 2;

////////////////////////////////////////////////////

		if (v_set[0][v_index] == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[0][v_index] := 99;
		if (v_set[0][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[0][v_index] := 1;


////////////////////////////////////////////////////


		if (v_set[v_index][v_index] == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index][v_index] := 99;
		if (v_set[v_index][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index][v_index] := 3;

////////////////////////////////////////////////////		

        var integer v_index2[2] := {1, 0};
        if (v_set[v_index2] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index2] := 99;
		if (v_set[v_index2] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index2] := 2;
	}

	testcase tc_setof_indexed_with_recordof() runs on GeneralComp {

		var SoISoI v_set := {{0, 1}, {2, 3}};
        var RoI1 v_index := { 1 }
////////////////////////////////////////////////////

		if (v_set[v_index] == {2, 3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index] := {5, 6};
		if (v_set[v_index] == {5, 6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index] := {2, 3};

////////////////////////////////////////////////////


		if (v_set[v_index][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index][0] := 99;
		if (v_set[v_index][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index][0] := 2;

////////////////////////////////////////////////////

		if (v_set[0][v_index] == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[0][v_index] := 99;
		if (v_set[0][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[0][v_index] := 1;


////////////////////////////////////////////////////


		if (v_set[v_index][v_index] == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index][v_index] := 99;
		if (v_set[v_index][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index][v_index] := 3;

////////////////////////////////////////////////////		

        var integer v_index2[2] := {1, 0};
        if (v_set[v_index2] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index2] := 99;
		if (v_set[v_index2] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index2] := 2;
	}

	testcase tc_setof_indexed_with_recordof_and_array() runs on GeneralComp {
		var SoISoISoISoI v_set := {
			{
				{
					{0, 1},
					{2, 3}
				},
				{
					{4, 5},
					{6, 7}
				}
			},
			{
				{
					{8, 9},
					{10, 11}
				},
				{
					{12, 13},
					{14, 15}
				}
			}
		}
		var integer v_index[1] := {0};
		var integer v_index2[2] := {0, 1};
		var RoI1 v_roi1 := {0};
		var RoI2 v_roi2 := {0, 1};


////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[v_index][v_index2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index][v_index2][v_index] := 99;
		if (v_set[v_index][v_index2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index][v_index2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[v_index][v_index2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index][v_index2][0] := 99;
		if (v_set[v_index][v_index2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index][v_index2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[v_index][0][1][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_index][0][1][v_index] := 99;
		if (v_set[v_index][0][1][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_index][0][1][v_index] := 2;

////////////////////////////////////////////////////

		// [0][0][1][0]
		if (v_set[v_roi1][v_index2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][v_index2][v_index] := 99;
		if (v_set[v_roi1][v_index2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][v_index2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[v_roi1][v_roi2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][v_roi2][v_index] := 99;
		if (v_set[v_roi1][v_roi2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][v_roi2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[v_roi1][v_roi2][v_roi1] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][v_roi2][v_roi1] := 99;
		if (v_set[v_roi1][v_roi2][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][v_roi2][v_roi1] := 2;


////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[v_roi1][v_roi2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][v_roi2][0] := 99;
		if (v_set[v_roi1][v_roi2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][v_roi2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[0][v_roi2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[0][v_roi2][0] := 99;
		if (v_set[0][v_roi2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[0][v_roi2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_set[v_roi1][0][1][v_roi1] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][0][1][v_roi1] := 99;
		if (v_set[v_roi1][0][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][0][1][v_roi1] := 2;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_set[v_roi1][1][1][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][1][1][v_roi1] := 99;
		if (v_set[v_roi1][1][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][1][1][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_set[v_roi1][v_roi2[1]][1][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][v_roi2[1]][1][v_roi1] := 99;
		if (v_set[v_roi1][v_roi2[1]][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][v_roi2[1]][1][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_set[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] := 99;
		if (v_set[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [1][0][1][1]
		if (v_set[v_roi2[1]][v_index2][v_index2[1]] == 11) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_set[v_roi2[1]][v_index2][v_index2[1]] := 99;
		if (v_set[v_roi2[1]][v_index2][v_index2[1]] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_set[v_roi2[1]][v_index2][v_index2[1]] := 11;
	}


//###########################################################################//
// Array indexed with array or record of


	testcase tc_array_indexed_with_array() runs on GeneralComp {
		var integer v_arr[2][2] := {{0, 1}, {2, 3}};
		var integer v_index[1] := { 1 }
////////////////////////////////////////////////////

		if (v_arr[v_index] == {2, 3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index] := {5, 6};
		if (v_arr[v_index] == {5, 6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index] := {2, 3};

////////////////////////////////////////////////////


		if (v_arr[v_index][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][0] := 99;
		if (v_arr[v_index][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][0] := 2;

////////////////////////////////////////////////////

		if (v_arr[0][v_index] == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[0][v_index] := 99;
		if (v_arr[0][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[0][v_index] := 1;


////////////////////////////////////////////////////


		if (v_arr[v_index][v_index] == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][v_index] := 99;
		if (v_arr[v_index][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][v_index] := 3;

////////////////////////////////////////////////////		

        var integer v_index2[2] := {1, 0};
        if (v_arr[v_index2] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index2] := 99;
		if (v_arr[v_index2] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index2] := 2;
	}

		testcase tc_array_indexed_with_recordof() runs on GeneralComp {
		var integer v_arr[2][2] := {{0, 1}, {2, 3}};
		var RoI1 v_index := { 1 }
////////////////////////////////////////////////////

		if (v_arr[v_index] == {2, 3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index] := {5, 6};
		if (v_arr[v_index] == {5, 6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index] := {2, 3};

////////////////////////////////////////////////////


		if (v_arr[v_index][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][0] := 99;
		if (v_arr[v_index][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][0] := 2;

////////////////////////////////////////////////////

		if (v_arr[0][v_index] == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[0][v_index] := 99;
		if (v_arr[0][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[0][v_index] := 1;


////////////////////////////////////////////////////


		if (v_arr[v_index][v_index] == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][v_index] := 99;
		if (v_arr[v_index][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][v_index] := 3;

////////////////////////////////////////////////////		

        var integer v_index2[2] := {1, 0};
        if (v_arr[v_index2] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index2] := 99;
		if (v_arr[v_index2] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index2] := 2;
	}


		testcase tc_array_indexed_with_recordof_and_array() runs on GeneralComp {
		var integer v_arr[2][2][2][2] := {
			{
				{
					{0, 1},
					{2, 3}
				},
				{
					{4, 5},
					{6, 7}
				}
			},
			{
				{
					{8, 9},
					{10, 11}
				},
				{
					{12, 13},
					{14, 15}
				}
			}
		}
		var integer v_index[1] := {0};
		var integer v_index2[2] := {0, 1};
		var RoI1 v_roi1 := {0};
		var RoI2 v_roi2 := {0, 1};


////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[v_index][v_index2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][v_index2][v_index] := 99;
		if (v_arr[v_index][v_index2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][v_index2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[v_index][v_index2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][v_index2][0] := 99;
		if (v_arr[v_index][v_index2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][v_index2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[v_index][0][1][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][0][1][v_index] := 99;
		if (v_arr[v_index][0][1][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][0][1][v_index] := 2;

////////////////////////////////////////////////////

		// [0][0][1][0]
		if (v_arr[v_roi1][v_index2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][v_index2][v_index] := 99;
		if (v_arr[v_roi1][v_index2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][v_index2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[v_roi1][v_roi2][v_index] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][v_roi2][v_index] := 99;
		if (v_arr[v_roi1][v_roi2][v_index] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][v_roi2][v_index] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[v_roi1][v_roi2][v_roi1] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][v_roi2][v_roi1] := 99;
		if (v_arr[v_roi1][v_roi2][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][v_roi2][v_roi1] := 2;


////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[v_roi1][v_roi2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][v_roi2][0] := 99;
		if (v_arr[v_roi1][v_roi2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][v_roi2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[0][v_roi2][0] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[0][v_roi2][0] := 99;
		if (v_arr[0][v_roi2][0] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[0][v_roi2][0] := 2;

////////////////////////////////////////////////////	

		// [0][0][1][0]
		if (v_arr[v_roi1][0][1][v_roi1] == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][0][1][v_roi1] := 99;
		if (v_arr[v_roi1][0][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][0][1][v_roi1] := 2;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_arr[v_roi1][1][1][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][1][1][v_roi1] := 99;
		if (v_arr[v_roi1][1][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][1][1][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_arr[v_roi1][v_roi2[1]][1][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][v_roi2[1]][1][v_roi1] := 99;
		if (v_arr[v_roi1][v_roi2[1]][1][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][v_roi2[1]][1][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [0][1][1][0]
		if (v_arr[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] := 99;
		if (v_arr[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi1][v_roi2[1]][v_index2[1]][v_roi1] := 6;

////////////////////////////////////////////////////	

		// [1][0][1][1]
		if (v_arr[v_roi2[1]][v_index2][v_index2[1]] == 11) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_roi2[1]][v_index2][v_index2[1]] := 99;
		if (v_arr[v_roi2[1]][v_index2][v_index2[1]] == 99) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_roi2[1]][v_index2][v_index2[1]] := 11;

	}


//###########################################################################//
// Array of charstring indexed with record of

	testcase tc_arrayfstr_indexed_with_recordof() runs on GeneralComp {
		var charstring v_arr[2][2] := {{"a", "b"}, {"c", "d"}};
		var RoI1 v_index := { 1 }

////////////////////////////////////////////////////

		if (v_arr[v_index] == {"c", "d"}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index] := {"x", "y"};
		if (v_arr[v_index] == {"x", "y"}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index] := {"c", "d"};

////////////////////////////////////////////////////		

		if (v_arr[v_index][0] == "c") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][0] := "x";
		if (v_arr[v_index][0] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][0] := "c";

////////////////////////////////////////////////////

		if (v_arr[0][v_index] == "b") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[0][v_index] := "x";
		if (v_arr[0][v_index] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[0][v_index] := "b";

////////////////////////////////////////////////////

		if (v_arr[v_index][v_index] == "d") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][v_index] := "x";
		if (v_arr[v_index][v_index] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][v_index] := "d";

////////////////////////////////////////////////////

        var RoI2 v_index2 := {1, 0};
        if (v_arr[v_index2] == "c") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index2] := "x";
		if (v_arr[v_index2] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index2] := "c";

	}


//###########################################################################//
// Array of charstring indexed with special indexing array

	type integer MyInt;

	testcase tc_array_indexed_with_spec_array() runs on GeneralComp {
		var charstring v_arr[2..4][2..4] := {{"a", "b", "c"}, {"d", "e", "f"}, {"g", "h", "i"}};
		var MyInt v_index[1..1] := {3};

////////////////////////////////////////////////////

		if (v_arr[v_index] == {"d", "e", "f"}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index] := {"x", "y", "z"};
		if (v_arr[v_index] == {"x", "y", "z"}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index] := {"d", "e", "f"};

////////////////////////////////////////////////////

		if (v_arr[v_index][2] == "d") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][2] := "x";
		if (v_arr[v_index][2] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][2] := "d";

////////////////////////////////////////////////////

		if (v_arr[2][v_index] == "b") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[2][v_index] := "x";
		if (v_arr[2][v_index] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[2][v_index] := "b";

////////////////////////////////////////////////////

		if (v_arr[v_index][v_index] == "e") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index][v_index] := "x";
		if (v_arr[v_index][v_index] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index][v_index] := "e";

////////////////////////////////////////////////////

        var MyInt v_index2[3..4] := {3, 2};
        if (v_arr[v_index2] == "d") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		// Assignment test
		v_arr[v_index2] := "x";
		if (v_arr[v_index2] == "x") {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
		// Restore to original value
		v_arr[v_index2] := "d";
	}


//###########################################################################//
// Constants indexing

	const RoRoI c_rois := {{1,2,3}, {4,5,6}};

	const RoI1 c_roi1_1 := {0};
	const RoI1 c_roi1_2 := {1};

	const RoI2 c_roi2_1 := {0, 2};
	const RoI2 c_roi2_2 := {1, 2}

	const RoI c_roi_1 := c_rois[c_roi1_1]; // {1,2,3}
	const RoI c_roi_2 := c_rois[c_roi1_2]; // {4,5,6}

	const IntArr1 c_intarr_1 := {0};
	const IntArr1 c_intarr_2 := {1};

	const integer c_int_1 := c_rois[c_roi2_1]; // 3
	const integer c_int_2 := c_rois[c_roi2_2]; // 6
	const integer c_int_3 := c_rois[c_roi1_1][c_roi1_1]; // 1
	const integer c_int_4 := c_rois[c_roi1_1][2]; // 3
	const integer c_int_5 := c_rois[1][c_roi1_1]; // 4

	const integer c_int_6 := c_rois[c_intarr_1][c_intarr_1]; // 1
	const integer c_int_7 := c_rois[c_intarr_1][c_roi1_1]; // 1
	const integer c_int_8 := c_rois[c_intarr_1][1]; // 2


	testcase tc_const_record_of_indexing() runs on GeneralComp {
		if (c_roi_1 == {1,2,3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_roi_2 == {4,5,6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_1 == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_2 == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_3 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_4 == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_5 == 4) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_6 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_7 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_8 == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}


	const SoISoI c_sois := {{1,2,3}, {4,5,6}};
	const SoI c_soi_1 := c_sois[c_roi1_1]; // {1,2,3}
	const SoI c_soi_2 := c_sois[c_roi1_2]; // {4,5,6}

	const integer c_int_9 := c_sois[c_roi2_1]; // 3
	const integer c_int_10 := c_sois[c_roi2_2]; // 6
	const integer c_int_11 := c_sois[c_roi1_1][c_roi1_1]; // 1
	const integer c_int_12 := c_sois[c_roi1_1][2]; // 3
	const integer c_int_13 := c_sois[1][c_roi1_1]; // 4

	const integer c_int_14 := c_sois[c_intarr_1][c_intarr_1]; // 1
	const integer c_int_15 := c_sois[c_intarr_1][c_roi1_1]; // 1
	const integer c_int_16 := c_sois[c_intarr_1][1]; // 2


	testcase tc_const_set_of_indexing() runs on GeneralComp {
		if (c_soi_1 == {1,2,3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_soi_2 == {4,5,6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_9 == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_10 == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_11 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_12 == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_13 == 4) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_14 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_15 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_16 == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}

	const integer c_arrarr[2][3] := {{1,2,3}, {4,5,6}}

	const integer c_arr_0[3] := c_arrarr[c_roi1_1]; // {1,2,3}
	const integer c_arr_1[3] := c_arr_0;
	const integer c_arr_2[3] := c_arrarr[c_roi1_2]; // {4,5,6}

	const integer c_int_17 := c_arrarr[c_roi2_1]; // 3
	const integer c_int_18 := c_arrarr[c_roi2_2]; // 6
	const integer c_int_19 := c_arrarr[c_roi1_1][c_roi1_1]; // 1
	const integer c_int_20 := c_arrarr[c_roi1_1][2]; // 3
	const integer c_int_21 := c_arrarr[1][c_roi1_1]; // 4

	const integer c_int_22 := c_arrarr[c_intarr_1][c_intarr_1]; // 1
	const integer c_int_23 := c_arrarr[c_intarr_1][c_roi1_1]; // 1
	const integer c_int_24 := c_arrarr[c_intarr_1][1]; // 2


	const integer c_arrarr_1[2..3][4..6] := {{1,2,3}, {4,5,6}}
	const RoI1 c_roi1_3 := {3};
	const RoI1 c_roi1_4 := {5};

	const integer c_int_25 := c_arrarr_1[c_roi1_3][c_roi1_4]; // 5


	testcase tc_const_array_indexing() runs on GeneralComp {
		if (c_arr_1 == {1,2,3}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_arr_2 == {4,5,6}) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_17 == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_18 == 6) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_19 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_20 == 3) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_21 == 4) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_22 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_23 == 1) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_24 == 2) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}

		if (c_int_25 == 5) {
			setverdict(pass);
		} else {
			setverdict(fail);
		}
	}


	control {
		execute(tc_recordof_indexed_with_array());
		execute(tc_recordof_indexed_with_recordof());
		execute(tc_recordof_indexed_with_recordof_and_array());

		execute(tc_setof_indexed_with_array());
		execute(tc_setof_indexed_with_recordof());
		execute(tc_setof_indexed_with_recordof_and_array());
		
		execute(tc_array_indexed_with_array());
		execute(tc_array_indexed_with_recordof());
		execute(tc_array_indexed_with_recordof_and_array());

		execute(tc_arrayfstr_indexed_with_recordof());
		execute(tc_array_indexed_with_spec_array());

		execute(tc_const_record_of_indexing());
		execute(tc_const_set_of_indexing());
		execute(tc_const_array_indexing());
	}

}
