Anxiety can make your stomach hurt. It’s long enough now that results from the unprotected sex will be correct on any pregnancy test, and if it’s been 21 days since any other sex, that’ll be definitive for that as well.
But I don’t think you’re pregnant if you’ve been taking your pill right. If you have thrown any up though, you may be unprotected from that.