Abstract. Given two weights σ, w on R n , the classical g-function satisfies the norm inequalityf L 2 (σ) if and only if the two weight Muckenhoupt A2 condition holds, and a family of testing conditions holds, namelyuniformly over all cubes I ⊂ R n , and Q(I) is the Carleson box over I. A corresponding characterization for the intrinsic square function of Wilson also holds.