Run some injector cleaner prior to the emission test. One or two tanks before. Make sure you run the car on the highway for a bit to clean it all out.. atleast 30minutes.
Do an oil change before the test as well.
Before the test, make sure the car is warm. Take it for a 20mintue drive. Highway if possible. Have the car tested when warm if possible.
I changed the Spark Plugs and Air Filter before the test as well. Even one of my winter cars, an 88 Toyota Corolla with 290,000KM passed the test. :-)
Hope it helps.