/***************************************************
 ** @author   STF 409
 ** @version  0.0.1
 ** @purpose  1:5.5, Ensure that the IUT correctly handles recursive functions
 ** @verdict  pass accept, ttcn3verdict:pass
 ***************************************************/
module Sem_0505_cyclic_definitions_001 {

type component GeneralComp {
}

function f_recursive(integer p_argument) return integer {
    if(p_argument==0) {
     return 1;
    }
    else {
     return p_argument*f_recursive(p_argument-1);
    }
}

testcase TC_Sem_0505_cyclic_definitions_001() runs on GeneralComp {
    if (f_recursive(10) == 3628800) {		// checks 10!
        setverdict(pass);
    }
    else {
        setverdict(fail);
    }
}

control{
    execute(TC_Sem_0505_cyclic_definitions_001());
}

}
