Steve's suggested way of checking is normally safe with our large scale toys but generally frowned upon in the small scales these days. It stems from the ability of some DCC systems to control a single un-chipped loco by "bending" the DCC signal that's on the track. Trouble is it means there'll be pulses of power going through the motor all the time hence the buzzing (and also all the lights will stay on all the time). Personally I don't recommend it for long term running but there are folk on here that run a loco that way on their DCC system without problems (and also some folk who have indeed blown up Piko locos by doing this!)
What DCC system are you using?
Most DCC systems provide a separate set of power outputs for a programming track, or at least some way of switching the main power output into programming mode.
A programming track is a separate length of track on which you place a decoder fitted loco to program it. The programing track output is deliberately limited power to prevent things blowing up if the decoder is wired incorrectly. Hence it's also ideal to check for a non-chipped loco.
Although you can program most modern decoders whilst the loco is on the main layout (this is often called "Programming On The Main" or "Operations Mode Programming"), a programming track is the only way to read back the decoder's current settings and to change the loco address.
Whilst it's not mandatory, some of us on here use a little device called a SPROG which is a neat way of using your computer for decoder programming if your DCC system isn't able to talk to a computer. It uses free software. I think SPROGs are currently about £50. I have an older model SPROG and find it very useful, but then again I do tinker with my decoders!