RFR: Initial section on testing [v2]

Igor Ignatyev iignatyev at openjdk.java.net
Mon Oct 19 22:30:27 UTC 2020


On Mon, 19 Oct 2020 22:14:21 GMT, Jesper Wilhelmsson <jwilhelm at openjdk.org> wrote:

>> src/index.md line 443:
>> 
>>> 441:     EXPECT_STREQ(expected_str, actual_str);
>>> 442:
>>> 443: `ASSERT` is a fatal assertion and will give you fast failure. That means that test execution will be stopped and
>>> the failure will be reported. `EXPECT` is a nonfatal assertion and will report the error but continues to run the test.
>>> All assertions have both an `ASSERT` and an `EXPECT` variant.
>> 
>> strictly speaking, `ASSERT` stops execution of the current method (as in fact it's just: change test's status, print
>> message, `return`), so if a test uses `ASSERT` in a subroutine, its _main test code_ has to call a subroutine within
>> `ASSERT_NO_FATAL_FAILURE` macro. it's explained in greater detail in `doc/hotspot-unit-tests.md`.
>
> Is there an easy way to explain this or can we leave more complex examples with subroutines to
> `doc/hotspot-unit.tests.md`?

I guess smth like "`ASSERT` interrupts execution of the current subroutine" should be sufficient for people to get
started.

-------------

PR: https://git.openjdk.java.net/guide/pull/30


More information about the guide-dev mailing list