Commit 73fffd90 authored by pintar's avatar pintar
Browse files

comment removed

parent 17c2840c
Loading
Loading
Loading
Loading
+20 −49
Original line number Diff line number Diff line
@@ -11,10 +11,10 @@ module Pos_07060101_extending_simple_content_001 {
    template E23el m_msg := {bar := 1, foo := 2.0, base := "something"}



    type universal charstring Raw;
    type universal charstring XsdFile;
    type record of XsdFile XsdFileList;

    type universal charstring File;
    type record of File FileList;

    type port P message {
        inout all;
@@ -23,18 +23,33 @@ module Pos_07060101_extending_simple_content_001 {
        port P p;
    }

	external function matchFile(Raw p_textToMatch, XsdFile p_referenceXmlFile, XsdFileList p_xsdFileList, out universal charstring p_matchError) return boolean;
	/**
	 * @desc lexical compare the charstring p_textToMatch with the contents of the reference XML file and returns true if they represent the same XML structure
	 * @param p_textToMatch text to be compared with the UTF-8 contents of the XML file
	 * @param p_referenceXmlFile the XML file
	 * @param p_xsdFileList the list of XSD files
	 * @param p_matchError the error result in case it did not match
	 * @param p_referenceTTCN3File the file of the TTCN-3 test module. This path is used to find the reference XML file relative to this path, by keeping the TTCN-3 code file system independent.
	 * @return true if p_textToMatch and the contents of p_referenceXmlFile represent the same XML structure
	 */
 	external function matchFile(Raw p_textToMatch, File p_referenceXmlFile, FileList p_xsdFileList, out universal charstring p_matchError, File p_referenceTTCN3File := __FILE__) return boolean;

    testcase TC_Pos_07060101_extending_simple_content_001() runs on C system C {
        var Raw v_rcv;
        var charstring v_matchError;
        var universal charstring v_matchError;

        map(self:p, system:p);

		// encode the message
        p.send(m_msg);

        alt {
        	// compare the encoded message with the reference XML file
            []	p.check(receive(Raw:?) -> value v_rcv) {
            	log("XML message ", v_rcv);
                if (matchFile(v_rcv, "Pos_07060101_extending_simple_content_001.xml", { "Pos_07060101_extending_simple_content_001.xsd" }, v_matchError)) {
                    alt {
                    	// match decoded value to pass test
                        [] p.receive(m_msg) {
                        	setverdict(pass, "Decoded value matches encoded template and reference XML");
                        }
@@ -57,49 +72,5 @@ module Pos_07060101_extending_simple_content_001 {
    }

    
//	type universal charstring Raw;
//	type port P message
//	{
//		inout E23el, Raw;
//	}
//	type component C
//	{
//		port P p;
//	}
//	external function matchFile(Raw p_textToMatch,
//		out charstring p_matchError) return boolean;
//	testcase TC() runs on C system C
//	{
//		var Raw v_rcv;
//		var charstring v_matchError;
//		map(self:p, system:p);
//        p.send(m_msg);
//        p.receive(m_msg);
//		alt {
//			[]	p.check(receive(Raw:?) -> value v_rcv) {
//				/*if (matchFile(v_rcv, v_matchError)) {
//					alt {
//						[] p.receive(m_test) {
//							setverdict(pass);
//						}
//						[] p.receive {
//							setverdict(fail, "XML decoding failure");
//						}
//					}
//				} else { 
//					setverdict(fail, v_matchError); 
//				}*/
//			}
//			[] p.receive {
//				setverdict(fail, "Raw decoding failure");
//			}
//		}
//	}
//	
//	control
//	{
//		execute(TC(), 5.0);
//	}
    
}