Make testcase more robust.

Replace testing the address of a function by testing the value of a global variable.