As demonstrated by #3763, it is easy for a simple bug or regression in the tests to cause tests to follow the wrong path and/or hide real failures. As it is, we cannot trust the results.
To help prevent this, we should be more careful to check inputs, "use strict", and perhaps refactor some tests or utils.
As an example, in the case of #3763, isInitDataTypeSupported() should check that its parameters are valid strings. Better yet, it should check that they are one of the known Key Systems and Initialization Data Types, respectively. (We can add helper isKnownFoo() functions then assert_true(isKnownFoo(foo)) in each relevant function.)
As demonstrated by #3763, it is easy for a simple bug or regression in the tests to cause tests to follow the wrong path and/or hide real failures. As it is, we cannot trust the results.
To help prevent this, we should be more careful to check inputs,
"use strict"
, and perhaps refactor some tests or utils.As an example, in the case of #3763,
isInitDataTypeSupported()
should check that its parameters are valid strings. Better yet, it should check that they are one of the known Key Systems and Initialization Data Types, respectively. (We can add helperisKnownFoo()
functions thenassert_true(isKnownFoo(foo))
in each relevant function.)/cc @mwatson2 @jdsmith3000 @paulbrucecotton