add testcase for ticket 3165