Adapt unit tests to the latest changes.

To simplify this, a new method is introduced to check whether two
nodes are connected in the control flow graph or not.