Just to add: pill form doesn't necessarily mean it's not pure MDMA; on the other hand, powder or crystal form doesn't mean it's pure MDMA. When buying illegal substances from unknown sources, the truth is you don't know what you are taking, period.
Correct, and to add on: Test kits are perfectly legal. There are also harm-reduction organizations like DanceSafe and Zendo that will help at festivals etc.