do_A07_testcase_11212(fd, scid) { var buf, bufLen; var exeResult; var cfg_atomType; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; var StatusCode; //the status code of the StartTransaction control c::util::logPrintf(fd, "A07-1-1-2-1(2):\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start Grammar\n"); c::util::logPrintf(fd, " Subsubgroup: Status code\n"); c::util::logPrintf(fd, " Detail: If the status code after a Start Transaction token indicates any number and is encoded with any size of uinteger atom,\n"); c::util::logPrintf(fd, " a tiny or short or medium or long atom, the Transaction start request SHALL NOT fail and the session SHALL NOT be\n"); c::util::logPrintf(fd, " aborted because of that. The TPer SHALL mirror a Start Transaction token and a following status code of which\n"); c::util::logPrintf(fd, " value is zero in the corresponding place in the message stream.\n\n"); switch (scid) { case 1: cfg_atomType = TCG_AtomType_TinyAtom; break; case 2: cfg_atomType = TCG_AtomType_ShortAtom; break; case 3: cfg_atomType = TCG_AtomType_MediumAtom; break; case 4: cfg_atomType = TCG_AtomType_LongAtom; break; default: print("Error: Incorrect scid ", scid, " is got!\n"); backtrace(); while (1); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); //Encode payload StatusCode = (scid - 1) % 3; CPE.initBuf(buf, bufLen); CPE.start(wd.session.ComID, 0); CPE.newPacket(wd.session.TSN, wd.session.HSN, 0); CPE.newDataSubPacket(); CPE.apd_1Btoken(CTRL_TOKEN_StartTransaction); CPE.enc_apd_uint_byAtomType(StatusCode, cfg_atomType); CPE.finishDataSubPacket(); CPE.finishPacket(); nComPacketLen = CPE.finish(); $1 = GetAtomNameByType(cfg_atomType); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a %s!\n", StatusCode, $1); // //send/receive payload // ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.session.ComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: StartTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.session.ComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); exeResult = TCG_Packet_CheckTPerResp_StartTransaction_ssnOpened(fd, buf, wd.session, 0); //close the session if (!EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to end the session!\n"); goto LLL_return; } c::util::logPrintf(fd, "\n"); PromptEndOfSession_success(fd, wd.session); c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); tag LLL_return: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } do_A07_testcase_1125_1126(fd, scid) { var buf, bufLen; var exeResult; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; var bSessionClosed; if (scid <= 4) { c::util::logPrintf(fd, "A07-1-1-2-5:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start Grammar\n"); c::util::logPrintf(fd, " Subsubgroup: Status code\n"); c::util::logPrintf(fd, " Detail: If the status code is encoded with a non-uinteger atom (for example an integer atom or a byte\n"); c::util::logPrintf(fd, " atom), the session SHALL be aborted.\n\n"); } else { c::util::logPrintf(fd, "A07-1-1-2-6:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start Grammar\n"); c::util::logPrintf(fd, " Subsubgroup: Status code\n"); c::util::logPrintf(fd, " Detail: If the status code is not encoded, the session SHALL be aborted.\n\n"); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); dev::ddbFillPat8(buf, 0); wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); bSessionClosed = 0; CPE.initBuf(buf, bufLen); CPE.start(wd.session.ComID, 0); CPE.newPacket(wd.session.TSN, wd.session.HSN, 0); CPE.newDataSubPacket(); CPE.apd_1Btoken(CTRL_TOKEN_StartTransaction); switch (scid) { case 1: CPE.apd_byteAtomHeader(TCG_AtomType_ShortAtom, 1); CPE.apd_byteAtomData(0); $1 = GetAtomNameByType(TCG_AtomType_ShortAtom); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a byte-type %s!\n", 0, $1); break; case 2: CPE.apd_byteAtomHeader(TCG_AtomType_MediumAtom, 1); CPE.apd_byteAtomData(0); $1 = GetAtomNameByType(TCG_AtomType_MediumAtom); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a byte-type %s!\n", 0, $1); break; case 3: CPE.apd_byteAtomHeader(TCG_AtomType_LongAtom, 1); CPE.apd_byteAtomData(0); $1 = GetAtomNameByType(TCG_AtomType_LongAtom); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a byte-type %s!\n", 0, $1); break; case 4: CPE.enc_apd_intAtomHeader(1, 1); CPE.apd_intAtomData(1); c::util::logPrintf(fd, "\nEncode the Status Code as an integer-type Atom with SBit on!\n"); break; case 5: c::util::logPrintf(fd, "\nNot encode the Status Code in the payload!\n"); break; default: print("Error: Incorrect scid ", scid, " is got!\n"); backtrace(); while (1); } CPE.finishDataSubPacket(); CPE.finishPacket(); nComPacketLen = CPE.finish(); // //The above StartTransaction with ill status code encoded would cause the session aborted! // ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: StartTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); if (TCG_Packet_IsCloseSessionResped(buf, wd.session)) { c::util::logPrintf(fd, "\nA CloseSession method was responsed!\n"); bSessionClosed = 1; } else exeResult = 0; //close the session if (!bSessionClosed) { if (!EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to end the session!\n"); goto LLL_return; } c::util::logPrintf(fd, "\n"); PromptEndOfSession_success(fd, wd.session); } c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); tag LLL_return: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } do_A07_testcase_12211_12212(fd, cid, scid) { var buf, bufLen; var exeResult; var cfg_atomType; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; var StatusCode_send; var StatusCode_expRecv; if (cid == 0x12211) { c::util::logPrintf(fd, "A07-1-2-2-1(1):\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction End Grammar\n"); c::util::logPrintf(fd, " Subsubgroup: Status code\n"); c::util::logPrintf(fd, " Detail: If the status code after an End Transaction token indicates 0 and is encoded with any size of uinteger atom, a tiny\n"); c::util::logPrintf(fd, " or short or medium or long atom, the Transaction commit request SHALL NOT fail and the session SHALL NOT be aborted\n"); c::util::logPrintf(fd, " because of that. The TPer SHALL mirror an End Transaction token and a following status code of which value is zero\n"); c::util::logPrintf(fd, " in the corresponding place in the message stream.\n\n"); StatusCode_send = 0; StatusCode_expRecv = 0; } else { c::util::logPrintf(fd, "A07-1-2-2-1(2):\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction End Grammar\n"); c::util::logPrintf(fd, " Subsubgroup: Status code\n"); c::util::logPrintf(fd, " Detail: If the status code after an End Transaction token indicates non-0 and is encoded with any size of uinteger atom, a tiny\n"); c::util::logPrintf(fd, " or short or medium or long atom, the Transaction commit request SHALL NOT fail and the session SHALL NOT be aborted\n"); c::util::logPrintf(fd, " because of that. The TPer SHALL mirror an End Transaction token and a following status code of which value is one\n"); c::util::logPrintf(fd, " in the corresponding place in the message stream.\n\n"); StatusCode_send = scid; StatusCode_expRecv = 1; } switch (scid) { case 1: cfg_atomType = TCG_AtomType_TinyAtom; break; case 2: cfg_atomType = TCG_AtomType_ShortAtom; break; case 3: cfg_atomType = TCG_AtomType_MediumAtom; break; case 4: cfg_atomType = TCG_AtomType_LongAtom; break; default: print("Error: Incorrect scid ", scid, " is got!\n"); backtrace(); while (1); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); //session wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); //start transaction if (!StartTransactionWithinASession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to start a new transaction!\n"); exeResult = 0; goto LLL_return2; } c::util::logPrintf(fd, "\nStart a new transaction!\n"); //encode payload (end transaction) CPE.initBuf(buf, bufLen); CPE.start(wd.session.ComID, 0); CPE.newPacket(wd.session.TSN, wd.session.HSN, 0); CPE.newDataSubPacket(); CPE.apd_1Btoken(CTRL_TOKEN_EndTransaction); CPE.enc_apd_uint_byAtomType(StatusCode_send, cfg_atomType); CPE.finishDataSubPacket(); CPE.finishPacket(); nComPacketLen = CPE.finish(); $1 = GetAtomNameByType(cfg_atomType); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a %s!\n", StatusCode_send, $1); // //send/receive payload // ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: EndTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); exeResult = TCG_Packet_CheckTPerResp_EndTransaction_ssnOpened(fd, buf, wd.session, StatusCode_expRecv); //close the session if (!EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to end the session!\n"); exeResult = 0; goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptEndOfSession_success(fd, wd.session); c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); tag LLL_return2: EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session); tag LLL_return1: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } do_A07_testcase_1225_1226(fd, scid) { var buf, bufLen; var exeResult; var cfg_atomType; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; var bSessionClosed; if (scid <= 4) { c::util::logPrintf(fd, "A07-1-2-2-5:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction End Grammar\n"); c::util::logPrintf(fd, " Subsubgroup: Status code\n"); c::util::logPrintf(fd, " Detail: If the status code is encoded with a non-uinteger atom (for example an integer atom or a byte atom), the session SHALL be aborted.\n\n"); } else { c::util::logPrintf(fd, "A07-1-2-2-6:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction End Grammar\n"); c::util::logPrintf(fd, " Subsubgroup: Status code\n"); c::util::logPrintf(fd, " Detail: If the status code is not encoded, the session SHALL be aborted.\n\n"); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); //session wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); //start transaction if (!StartTransactionWithinASession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to start a new transaction!\n"); exeResult = 0; goto LLL_return2; } c::util::logPrintf(fd, "\nStart a new transaction!\n"); bSessionClosed = 0; //encode payload (end transaction) dev::ddbFillPat8(buf, 0); CPE.initBuf(buf, bufLen); CPE.start(wd.session.ComID, 0); CPE.newPacket(wd.session.TSN, wd.session.HSN, 0); CPE.newDataSubPacket(); CPE.apd_1Btoken(CTRL_TOKEN_EndTransaction); switch (scid) { case 1: CPE.apd_byteAtomHeader(TCG_AtomType_ShortAtom, 1); CPE.apd_byteAtomData(0); $1 = GetAtomNameByType(TCG_AtomType_ShortAtom); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a byte-type %s!\n", 0, $1); break; case 2: CPE.apd_byteAtomHeader(TCG_AtomType_MediumAtom, 1); CPE.apd_byteAtomData(0); $1 = GetAtomNameByType(TCG_AtomType_MediumAtom); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a byte-type %s!\n", 0, $1); break; case 3: CPE.apd_byteAtomHeader(TCG_AtomType_LongAtom, 1); CPE.apd_byteAtomData(0); $1 = GetAtomNameByType(TCG_AtomType_LongAtom); c::util::logPrintf(fd, "\nEncode the Status Code %Xh as a byte-type %s!\n", 0, $1); break; case 4: CPE.enc_apd_intAtomHeader(1, 1); CPE.apd_intAtomData(1); c::util::logPrintf(fd, "\nEncode the Status Code as an integer-type Atom with SBit on!\n"); break; case 5: c::util::logPrintf(fd, "\nNot encode the Status Code in the payload!\n"); break; default: print("Error: Incorrect scid ", scid, " is got!\n"); backtrace(); while (1); } CPE.finishDataSubPacket(); CPE.finishPacket(); nComPacketLen = CPE.finish(); // //send/receive payload; the above payload encoded would cause the session aborted! // ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: EndTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); if (TCG_Packet_IsCloseSessionResped(buf, wd.session)) { c::util::logPrintf(fd, "\nA CloseSession method was responsed!\n"); bSessionClosed = 1; } else exeResult = 0; //close the session if (!bSessionClosed) { if (!EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to end the session!\n"); goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptEndOfSession_success(fd, wd.session); } c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); tag LLL_return2: EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session); tag LLL_return1: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } do_A07_testcase_1311_1312(fd, cid) { var buf, bufLen; var exeResult; var cfg_atomType; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; var nCount; var bSessionClosed; if (cid == 0x1311) { c::util::logPrintf(fd, "A07-1-3-1-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Transaction start attemp\n"); c::util::logPrintf(fd, " Detail: If the (Start Transaction token) + (any status code) is sent and that does not cause the number of\n"); c::util::logPrintf(fd, " the open transactions in the session to exceed the value of the TPer's MaxTransactionLimit property,\n"); c::util::logPrintf(fd, " the Transaction start request SHALL NOT fail and the session SHALL NOT be aborted because of that.\n\n"); } else { c::util::logPrintf(fd, "A07-1-3-1-2:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Transaction start attemp\n"); c::util::logPrintf(fd, " Detail: If the (Start Transaction token) + (any status code) is sent and that causes the number of the open\n"); c::util::logPrintf(fd, " transactions in the session to exceed the value of the TPer's MaxTransactionLimit property, the session\n"); c::util::logPrintf(fd, " SHALL be aborted.\n\n"); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); c::util::logPrintf(fd, "TPerProperties.MaxTransactionLimit = %d.\n", wd.tperProps.MaxTransactionLimit); //session wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); //start transaction for (nCount = 0; nCount < wd.tperProps.MaxTransactionLimit; ++nCount) { c::util::logPrintf(fd, "\nStart a new%s transaction!\n", nCount ? " level" : ""); if (!StartTransactionWithinASession(nCount < (wd.tperProps.MaxTransactionLimit - 1) ? cMessageLevel_none : cMessageLevel_detail, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to start a new transaction!\n"); exeResult = 0; goto LLL_return2; } c::util::logPrintf(fd, "\nStart a new transaction successfully!\n"); } bSessionClosed = 0; if (cid == 0x1312) { c::util::logPrintf(fd, "\nStart a new level transaction!\n"); nComPacketLen = TCG_Packet_BuildStartTransactionControl(buf, bufLen, wd.session); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: StartTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); if (TCG_Packet_IsCloseSessionResped(buf, wd.session)) { c::util::logPrintf(fd, "\nA CloseSession method was responsed!\n"); bSessionClosed = 1; } else exeResult = 0; } //close the session if (!bSessionClosed) { if (!EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to end the session!\n"); goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptEndOfSession_success(fd, wd.session); } c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); tag LLL_return2: EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session); tag LLL_return1: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } //1321, 1322, 1331, 1332 do_A07_testcase_1_3_23_12(fd, cid) { var buf, bufLen; var exeResult; var cfg_atomType; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var nETSC_send; //EndTransaction status code in send var ErrCode, Status; var nCount; var bSessionClosed; switch (cid) { case 0x1321: c::util::logPrintf(fd, "A07-1-3-2-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Transaction commit attemp\n"); c::util::logPrintf(fd, " Detail: If the (End Transaction token) + (status code 0) is sent outside of a transaction, the session SHALL be aborted.\n\n"); nETSC_send = 0; break; case 0x1322: c::util::logPrintf(fd, "A07-1-3-2-2:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Transaction commit attemp\n"); c::util::logPrintf(fd, " Detail: If the (End Transaction token) + (status code 0) is sent within a transaction, and:\n"); c::util::logPrintf(fd, " i) if the Transaction commit does not fail, the Transaction commit request SHALL be completed and (End Transaction\n"); c::util::logPrintf(fd, " token) + (status code 0) SHALL be sent in the equivalent place the host encoded in the message stream.\n"); c::util::logPrintf(fd, " ii) if the Transaction commit fails, the Transaction SHALL be aborted and (End Transaction token) + (status code 1)\n"); c::util::logPrintf(fd, " SHALL be sent in the equivalent place the host encoded in the message stream.\n\n"); nETSC_send = 0; break; case 0x1331: c::util::logPrintf(fd, "A07-1-3-3-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Transaction abort attemp\n"); c::util::logPrintf(fd, " Detail: If the (End Transaction token) + (status code non-0) is sent outside of a transaction, the session SHALL be aborted.\n\n"); nETSC_send = 1; break; case 0x1332: c::util::logPrintf(fd, "A07-1-3-3-2:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Transaction abort attemp\n"); c::util::logPrintf(fd, " Detail: If the (EndTransaction token) + (status code non-0) is sent within a transaction, the Transaction abort request SHALL NOT\n"); c::util::logPrintf(fd, " fail and (End Transaction token) + (status code 1) SHALL be sent in the equivalent place the host encoded in the message stream.\n\n"); nETSC_send = 1; break; default: print("Error: Incorrect cid ", cid, " is got!\n"); backtrace(); while (1); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); //session wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); //start transaction if (cid == 0x1322 || cid == 0x1332) { if (!StartTransactionWithinASession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to start a new transaction!\n"); exeResult = 0; goto LLL_return2; } c::util::logPrintf(fd, "\nStart a transaction!\n"); } bSessionClosed = 0; c::util::logPrintf(fd, "\nEnd Transaction with Status Code as %d!\n", nETSC_send); nComPacketLen = TCG_Packet_BuildEndTransactionControl(buf, bufLen, wd.session, nETSC_send); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: EndTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); if (cid == 0x1322 || cid == 0x1332) { } else { //the EndTransaction is outside a transaction! if (!TCG_Packet_IsCloseSessionResped(buf, wd.session)) { c::util::logPrintf(fd, "\nError: TPer should response session abort by a CloseSession() method!\n"); exeResult = 0; } else { c::util::logPrintf(fd, "\nA CloseSession method was responsed!\n"); bSessionClosed = 1; } } //close the session if (!bSessionClosed) { if (!EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to end the session!\n"); goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptEndOfSession_success(fd, wd.session); } c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); tag LLL_return2: EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session); tag LLL_return1: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } //1341, 1351, 1361 do_A07_testcase_1_3_456_1(fd, cid) { var buf, bufLen; var exeResult; var cfg_atomType; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; var nLoop_num, nLoop_cnt; // var nStart_num, nStart_cnt; // for submitting number of StartTransactions and EndTransactions var nEnd_num, nEnd_cnt; // var bSessionClosed = 0; switch (cid) { case 0x1341: c::util::logPrintf(fd, "A07-1-3-4-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Stand-alone Transaction Start\n"); c::util::logPrintf(fd, " Detail: If there are only Start Transaction token and a status token after that in the Subpacket, the\n"); c::util::logPrintf(fd, " Transaction start request SHALL NOT fail and the session SHALL NOT be aborted because of that.\n\n"); nLoop_num = 1; nStart_num = 1; nEnd_num = 0; break; case 0x1351: c::util::logPrintf(fd, "A07-1-3-5-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Stand-alone Transaction End\n"); c::util::logPrintf(fd, " Detail: When a transaction is in process,and if a Subpacket is sent where only one End Transaction token and one\n"); c::util::logPrintf(fd, " status token after that are contained in the Subpacket, the Transaction end request SHALL NOT cause a session\n"); c::util::logPrintf(fd, " abort, and the End Transaction reply from the TPer SHALL contain the proper status (either Commit or Abort)\n"); c::util::logPrintf(fd, " based on the status of the End Transaction sent by the host, unless there is some other error factor.\n\n"); nLoop_num = 1; nStart_num = 1; nEnd_num = 1; break; case 0x1361: c::util::logPrintf(fd, "A07-1-3-6-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Multiple transaction start/end\n"); c::util::logPrintf(fd, " Detail: If one or more Transaction commit(s)/abort(s) occur within the session, the next time of Transaction start\n"); c::util::logPrintf(fd, " request SHALL NOT fail because of that.\n\n"); nLoop_num = 3; nStart_num = 3; nEnd_num = 3; break; default: print("Error: Incorrect cid ", cid, " is got!\n"); backtrace(); while (1); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); //session wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); nStart_cnt = 0; nEnd_cnt = 0; for (nLoop_cnt = 1; nLoop_cnt <= nLoop_num; ++nLoop_cnt) { if (nLoop_num > 1) c::util::logPrintf(fd, "\nTransaction iteration: %d!\n", nLoop_cnt); if (nStart_cnt < nStart_num) { ++nStart_cnt; c::util::logPrintf(fd, "\nStart Transaction!\n"); nComPacketLen = TCG_Packet_BuildStartTransactionControl(buf, bufLen, wd.session); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: StartTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); } if (nEnd_cnt < nEnd_num) { ++nEnd_cnt; c::util::logPrintf(fd, "\nEnd Transaction with Status Code as %d!\n", 0); nComPacketLen = TCG_Packet_BuildEndTransactionControl(buf, bufLen, wd.session, 0); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: EndTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); exeResult = TCG_Packet_CheckTPerResp_EndTransaction_ssnOpened(fd, buf, wd.session, 0); } } //close the session if (!EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session)) { c::util::logPrintf(fd, "\nError: Fail to end the session!\n"); goto LLL_return1; } c::util::logPrintf(fd, "\n"); PromptEndOfSession_success(fd, wd.session); c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); tag LLL_return2: EndOfSession(cMessageLevel_none, fd, wd.tperProps, wd.session); tag LLL_return1: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } do_A07_testcase_1381(fd, scid) { var buf, bufLen; var exeResult; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; c::util::logPrintf(fd, "A07-1-3-8-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction Start/End situation\n"); c::util::logPrintf(fd, " Subsubgroup: Transaction attemp in a Control Session\n"); c::util::logPrintf(fd, " Detail: If a \"StartTransaction token + status\" or an \"EndTransaction token + status\" is encoded outside of a method\n"); c::util::logPrintf(fd, " invocation in a Control Session, the token SHALL be discarded.\n\n"); exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); if (scid == 1) { //send c::util::logPrintf(fd, "\nStart Transaction!\n"); nComPacketLen = TCG_Packet_BuildStartTransactionControl(buf, bufLen, wd.session); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: StartTransaction Control", wd.session.SP_UID, nMSC); //receive dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); //check if (!TCG_Packet_CheckTPerResp_NoResp(fd, 1, buf, wd.session.ComID)) { c::util::logPrintf(fd, "\nError: TPer should discard the sent packet!\n"); exeResult = 0; } else { c::util::logPrintf(fd, "\nTPer discard the sent packet!\n"); } } else { //send c::util::logPrintf(fd, "\nEnd Transaction with Status Code as %d!\n", 0); nComPacketLen = TCG_Packet_BuildEndTransactionControl(buf, bufLen, wd.session, 0); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: EndTransaction Control", wd.session.SP_UID, nMSC); //receive dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); //check if (!TCG_Packet_CheckTPerResp_NoResp(fd, 1, buf, wd.session.ComID)) { c::util::logPrintf(fd, "\nError: TPer should discard the sent packet!\n"); exeResult = 0; } else { c::util::logPrintf(fd, "\nTPer discard the sent packet!\n"); } } c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } //1611, 1711, 1811 do_A07_testcase_1_678_1_1(fd, cid) { var buf, bufLen; var exeResult; struct ComPacketEnc_t CPE; var nComPacketLen; var nMSC; //nMSC: method's status code var ErrCode, Status; var bSessionClosed = 0; switch (cid) { case 0x1611: c::util::logPrintf(fd, "A07-1-6-1-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction + Session abort\n"); c::util::logPrintf(fd, " Detail: If a transaction has been started successfully and the session gets aborted without a transaction commit\n"); c::util::logPrintf(fd, " or abort request to the transaction, the transaction SHALL be aborted.\n\n"); break; case 0x1711: c::util::logPrintf(fd, "A07-1-7-1-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction + Session close\n"); c::util::logPrintf(fd, " Detail: If a transaction has been started successfully and the session gets closed (accomplished by sending an EOS\n"); c::util::logPrintf(fd, " token.) without a transaction commit or abort request to the transaction, the transaction SHALL be aborted.\n\n"); break; case 0x1811: c::util::logPrintf(fd, "A07-1-8-1-1:\n"); c::util::logPrintf(fd, " Group: Transaction start/commit/abort in a Regular Session\n"); c::util::logPrintf(fd, " Subgroup: Transaction + Power Cycle\n"); c::util::logPrintf(fd, " Detail: If a transaction has been started successfully and a power cycle happens without a transaction commit or\n"); c::util::logPrintf(fd, " abort request to the transaction, the transaction SHALL be aborted.\n\n"); break; default: print("Error: Incorrect cid ", cid, " is got!\n"); backtrace(); while (1); } exeResult = 1; dev::cleanCmdHistory(); bufLen = 4096; buf = dev::ddbAlloc(bufLen); //session wd.goNewSession(UID_AdminSP, 1, UID_Anybody, ""); StartSession(cMessageLevel_none, fd, wd.tperProps, wd.session, MSC_SUCCESS); if (wd.session.TSN == INVALID_SESSION_NUM) { c::util::logPrintf(fd, "\nError: Fail to start a new session!\n"); exeResult = 0; goto LLL_return; } c::util::logPrintf(fd, "\n"); PromptSessionInfo(fd, wd.session, "Start Session; "); c::util::logPrintf(fd, "\nStart Transaction!\n"); nComPacketLen = TCG_Packet_BuildStartTransactionControl(buf, bufLen, wd.session); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: StartTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); //interrupt; one of session abort, session close, and power cycle if (cid == 0x1611) { //send an ill ComPacket to make session aborted dev::ddbFillPat8(buf, 0); CPE.initBuf(buf, bufLen); CPE.start(wd.session.ComID, 0); CPE.newPacket(wd.session.TSN, wd.session.HSN, 0); CPE.newDataSubPacket(); CPE.apd_1Btoken(CTRL_TOKEN_EndOfData); //<--- incorrect token used CPE.enc_apd_intAtomHeader(1, 8); //InvokingID //<--- ill InvokingID CPE.apd_intAtomData((UID_TableTable_Table >> 56) & 0xFF); CPE.apd_intAtomData((UID_TableTable_Table >> 48) & 0xFF); CPE.apd_intAtomData((UID_TableTable_Table >> 40) & 0xFF); CPE.apd_intAtomData((UID_TableTable_Table >> 32) & 0xFF); CPE.apd_intAtomData((UID_TableTable_Table >> 24) & 0xFF); CPE.apd_intAtomData((UID_TableTable_Table >> 16) & 0xFF); CPE.apd_intAtomData((UID_TableTable_Table >> 8 ) & 0xFF); CPE.apd_intAtomData((UID_TableTable_Table ) & 0xFF); CPE.enc_apd_uid(UID_CORE_METHOD_Next); //MethodID CPE.apd_1Btoken(SEQ_TOKEN_StartList); CPE.apd_1Btoken(SEQ_TOKEN_EndList); CPE.apd_1Btoken(CTRL_TOKEN_EndOfData); CPE.enc_apd_statusList(MSC_SUCCESS); //Method Status List CPE.finishDataSubPacket(); CPE.finishPacket(); nComPacketLen = CPE.finish(); c::util::logPrintf(fd, "\nSend an ill ComPacket to the device to make session abort!\n"); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: ill ComPacket", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); } else if (cid == 0x1711) { c::util::logPrintf(fd, "\nEndOfSession\n"); EndOfSession(cMessageLevel_detail, fd, wd.tperProps, wd.session); } else { DoPowerCycleAndReinit(fd, 3); } // //verify that the transaction is closed by ending the transaction // c::util::logPrintf(fd, "\nEnd Transaction with Status Code as %d!\n", 0); nComPacketLen = TCG_Packet_BuildEndTransactionControl(buf, bufLen, wd.session, 0); ErrCode = dev::TCG_Send_1(1, fd, buf, nComPacketLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "Host -> TPer: EndTransaction Control", wd.session.SP_UID, nMSC); dev::ddbFillPat8(buf, 0); ErrCode = dev::TCG_Recv_1(fd, buf, bufLen, wd.BaseComID, Status); c::util::logPrintf(fd, "\n"); TCG_Packet_DCRComPacket_generalFormat(1, fd, buf, "TPer -> Host: Response", wd.session.SP_UID, nMSC); if (!TCG_Packet_CheckTPerResp_NoResp(fd, 1, buf, wd.session.ComID)) { c::util::logPrintf(fd, "\nError: TPer should discard the sent packet!\n"); exeResult = 0; } else { c::util::logPrintf(fd, "\nTPer discard the sent packet!\n"); } c::util::logPrintf(fd, "\n"); dev::dumpCmdHistory(fd, 0); tag LLL_return: dev::ddbFree(buf); return (exeResult ? TR_PASS : TR_FAIL); } A07_Transaction(dir, &itemStr, &testResultCounters[3]) { var logFileName; var fd, testResult; var nCaseCount; var name; var scid; c::sprintf(logFileName, "%s/%s.log", dir, __FUNCTION__); fd = c::fopen(logFileName, "w"); itemStr = "A7. Transaction"; c::util::logPrintf(fd, "%s\n\n", itemStr); c::util::logPrintf(fd, "%-40s: %s\n", "Test start date/time", sys::getCurLocalTimeStr()); testResultCounters[0] = 0; testResultCounters[1] = 0; testResultCounters[2] = 0; nCaseCount = 0; //A7-1-1-2-1(2) for (scid = 1; scid <= 4; ++scid) { TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_11212(fd, scid); //scid: determine atom type used for the Status code TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; } //A7-1-1-2-5, A7-1-1-2-6 for (scid = 1; scid <= 5; ++scid) { TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1125_1126(fd, scid); //scid: determine atom type and SBit used for the Status code //scid = 5, test on A7-1-1-2-6 TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; } //A7-1-2-2-1(1) for (scid = 1; scid <= 4; ++scid) { TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_12211_12212(fd, 0x12211, scid); //scid: determine atom type used for the Status code TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; } //A7-1-2-2-1(2) for (scid = 1; scid <= 4; ++scid) { TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_12211_12212(fd, 0x12212, scid); //scid: determine atom type used for the Status code TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; } //A7-1-2-2-5, A7-1-2-2-6 for (scid = 1; scid <= 5; ++scid) { TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1225_1226(fd, scid); //scid: determine atom type used for the Status code //scid = 5, test on A7-1-2-2-6 TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; } //A7-1-3-1-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1311_1312(fd, 0x1311); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-1-2 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1311_1312(fd, 0x1312); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-2-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_3_23_12(fd, 0x1321); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-2-2 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_3_23_12(fd, 0x1322); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-3-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_3_23_12(fd, 0x1331); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-3-2 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_3_23_12(fd, 0x1332); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-4-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_3_456_1(fd, 0x1341); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-5-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_3_456_1(fd, 0x1351); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-6-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_3_456_1(fd, 0x1361); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-8-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1381(fd, 1); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-3-8-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1381(fd, 2); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-6-1-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_678_1_1(fd, 0x1611); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-7-1-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_678_1_1(fd, 0x1711); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; //A7-1-8-1-1 TestCaseBegin(fd, ++nCaseCount); testResult = do_A07_testcase_1_678_1_1(fd, 0x1811); TestCaseEnd(fd, nCaseCount, testResult); ++testResultCounters[testResult]; c::util::logPrintf(fd, "\n\n"); c::util::logPrintf(fd, "------------------------------------------------------------\n"); c::util::logPrintf(fd, "%-40s: %d\n", "Passed cases", testResultCounters[TR_PASS]); c::util::logPrintf(fd, "%-40s: %d\n", "Failed cases", testResultCounters[TR_FAIL]); c::util::logPrintf(fd, "%-40s: %d\n", "Skipped cases", testResultCounters[TR_SKIP]); c::util::logPrintf(fd, "------------------------------------------------------------\n"); c::util::logPrintf(fd, "\n%-40s: %s\n\n", "Test end date/time", sys::getCurLocalTimeStr()); c::fclose(fd); }