If you fail the smog test, you still pay the money but you get to retake the test for free within a certain time frame (not sure on the time frame).

If the car is OBDII, then they just plug into the computer and check for codes. The actual tailpipe test is done on earlier vehicles.