Local error estimates and regularity tests for the implementation of double adaptive quadrature