Improve tests

* Reduce globals usage thanks to core improvements
* Use new assertion that wasn't available before

Change-Id: I9b7fb065ea9e235e6c5e7ea5116ccacac91f8846