Commit 1c999a4f authored by stancakapost's avatar stancakapost
Browse files

- added decode test macro: TC_Decode

- added encode/decode test macro (without XML testing): TC_NoXMLMatch
parent 9db1cffc
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -11,7 +11,6 @@
    }
    }


	external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean;
	external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean;
//    external function matchFile(Raw p_textToMatch, charstring p_filePath, out charstring p_matchError) return boolean;


    testcase TC_${module}() runs on C system C {
    testcase TC_${module}() runs on C system C {
        var Raw v_rcv;
        var Raw v_rcv;
@@ -23,7 +22,7 @@
                if (matchFile(v_rcv, "${module}.xml", ${xsdFileList}, v_matchError)) {
                if (matchFile(v_rcv, "${module}.xml", ${xsdFileList}, v_matchError)) {
                    alt {
                    alt {
                        [] p.receive(m_msg) {
                        [] p.receive(m_msg) {
                            setverdict(pass);
                        	setverdict(pass, "Decoded value matches encoded template and reference XML");
                        }
                        }
                        [] p.receive {
                        [] p.receive {
                            setverdict(fail, "XML decoding failure");
                            setverdict(fail, "XML decoding failure");
+38 −0
Original line number Original line Diff line number Diff line

    type universal charstring Raw;

    type port P message {
        inout all;
    }
    type component C {
        port P p;
    }

	external function readFile(universal charstring p_referenceXmlFile) return universal charstring;

    testcase TC_${module}() runs on C system C {
        var Raw v_rcv;
        map(self:p, system:p);
        v_rcv := readFile("${module}.xml");
        p.send(v_rcv);
        alt {
            []	p.check(receive(Raw:?) -> value v_rcv) {
            	log("XML message ", v_rcv);
                alt {
                    [] p.receive(m_msg) {
                        setverdict(pass, "Decoded value matches template");
                    }
                    [] p.receive {
                        setverdict(fail, "XML decoding failure");
                    }
                }
            }
            [] p.receive {
                setverdict(fail, "Raw decoding failure");
            }
        }
    }

    control {
        execute(TC_${module}(), 5.0);
    }
+35 −0
Original line number Original line Diff line number Diff line

    type universal charstring Raw;

    type port P message {
        inout all;
    }
    type component C {
        port P p;
    }

    testcase TC_${module}() runs on C system C {
        var Raw v_rcv;
        map(self:p, system:p);
        p.send(m_msg);
        alt {
            []	p.check(receive(Raw:?) -> value v_rcv) {
            	log("XML message ", v_rcv);
                alt {
                    [] p.receive(m_msg) {
                        setverdict(pass, "Decoded value matches encoded template");
                    }
                    [] p.receive {
                        setverdict(fail, "XML decoding failure");
                    }
                }
            }
            [] p.receive {
                setverdict(fail, "Raw decoding failure");
            }
        }
    }

    control {
        execute(TC_${module}(), 5.0);
    }