Test program for exception thrown in constructor