Confirmation of the diagnosis is made with the help of tests such as endoscopies or barium contrast x-rays. The tests are typically ordered if the symptoms do not resolve after a few weeks of treatment, or when they first appear in a person who is over age 45 or who has other symptoms such as weight loss, because stomach cancer can cause similar symptoms. Also, when severe ulcers resist treatment, particularly if a person has several ulcers or the ulcers are in unusual places, a doctor may suspect an underlying condition that causes the stomach to overproduce acid.