This system is called the Emergency Action System (EAS). The sound bursts that you object to are the Specific Area Message Encoding (SAME), a digital stream that gives the particulars of the Emergency. It is a requirement of broadcasters to test each week the local EAS activation (the ones that would be used for local emergencies, say weather, or other large scale emergencies that affect a particular set of counties), these use no attention tones.
Once a month they test a larger scale activation, ones that would affect an entire state, or national government. These are the ones that use the attention tones (853 Hertz and 960 hertz mixed together, and yes they do certainly hurt the ear, intentionally so). It is the national alerts that would be warning of a state of war and the like.