rbei-etas / busmaster

BUSMASTER is an Open Source Software tool to simulate, analyze and test data bus systems such as CAN. BUSMASTER was conceptualized, designed and implemented by Robert Bosch Engineering and Business Solutions (RBEI). Presently it is a joint project of RBEI and ETAS GmbH.
http://rbei-etas.github.com/busmaster/
GNU General Public License v3.0
951 stars 502 forks source link

Does VerifyResponse work? #697

Open GT-Derka opened 10 years ago

GT-Derka commented 10 years ago

I'm trying to get the idea of the VerifyResponse-Test step in Test Automation, but I'm not able to get anything to work. The general idea of verification in test automation is to "Send" a message, "wait" some time and "verify" the answer, right? To verify there are two possibilities in busmaster:

Is there any working example, which shows the usage of VerifyResponse? I studied the SampleTestSetupFile.xml, but there is no explanation at all. It would be great, to have a XML-TestSetup, a NodeSimulation-Cpp-Code and the expected results of the test. Thanks in advance.

GT-Derka commented 10 years ago

I had a glimpse at TSX_VerifyResponse(...) in TSExecutionCAN.cpp. Correct me, if I'm wrong, but I found the following: UINT64 m_LastCanMsg; ... if(mLastCanMsg != -1) { omStrCount.Format(("SUCCESS COUNT %d"), mMsgVerifiedList.GetCount()); } else { omStrCount.Format(("No Message has Recieved")); } So the else-path can never be reached -> The test will always succeed.

Additionally there are a few other points I don't understand at the moment. Thus for me there is one general question: Does the VerifyResponse-Test step generally work at the moment? If not, I can stop trying to understand its function and my problems. Thanks in advance!

etas-lorenz commented 10 years ago

I looked in the function and have to agree that how it's currently implemented is wrong. If WaitForSingleObject is successful the string "SUCCESS" is displayed. If not, the conditions currently lead to the message "No Message has Recieved". The path in which a "SUCCESS COUNT" is shown is unreachable. That's a bug.

RBEI-VENKAT commented 10 years ago