test: refactor `common.expectWarning()`
The current API is somewhat confusing at times and simpler usage is possible. This overloads the arguments further to accept objects with deprecation codes as property keys. It also adds documentation for the different possible styles.
Besides that it is now going to validate for the code being present
in case of deprecations but not for other cases. The former validation
was not consistent as it only validated some cases and accepted
undefined instead of common.NoWarnCode
. This check is removed due to
the lack of consistency.
This also verifies that the warning order is identical to the order in which they are triggered.
I also removed common.noWarnCode
since it's not really required after
making sure all deprecation warnings have a code.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines