Using automation testing for catching expected errors
Suppose I have a piece of program that logs an error.
And I write an automation test that actually expects this log to be printed.
How can I ensure that my test passes? It now directly fails, because of the UE_LOG in the actual source code.
asked Jul 19 '17 at 12:29 PM in C++ Programming
We recently added support for this, and I believe it is expected to ship as part of 4.17. You'd want to use the new AddExpectedError method in the test body, which allows you to define a regex describing the expected error/warning message, the type of comparison to perform, and the number of times you expect the message to occur during the test.
Example from one of the unit tests:
From your example, your test would look something like:
answered Jul 19 '17 at 02:09 PM
Adr1c ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here