A CAUTION ABOUT CODE READERS!
Code readers have a button which will turn off your "Check Engine" light. This doesn't just turn off the light. It clears all stored codes and, as I recall, clears the monitors.
The "monitors" are a group of overall routines that ensure that testing has been completed in each of a small number of function groups. And certain driving sequences have to be completed a few times over periods of time to complete these test cycles.
In normal driving, sooner or later, all of these sequences will be completed to satisfy your car's computer programs: each monitor will be completed. On my code reader, a group of monitors are displayed by their names: when they haven't been completed, they blink.
Completing these sequences can be hastened by driving the car according to precise scripts, called "Drive Cycles." I described my hair-raising experiences in running the drive cycles for my 2000 Sonata much earlier here on this newsgroup.
In California, and maybe other U.S. states, too, your car will flunk the smog test if the monitors have not been completed. You have some leeway in this: the last time that I checked, you were allowed for two monitors to be incomplete.
The monitors just indicate that the car's own testing has been completed. It they do not show that the car won't produce excessive emissions, fail specifications, etc: the car can still fail the smog test.
If you clear the dashboard light, clearing stored codes and zeroing the monitors, then go for your smog test, your car will fail because the monitors won't have been completed yet. You'll have to bring the car back to the test station after enough driving has satisfied the computer. This may take a couple of weeks or maybe longer.
And if you were in a hurry because your registration expired tomorrow, you'll be driving on expired registration in order to complete the monitors.
So, think clearly before shutting off that dash light. In most cases, when you take care of the problem that caused the light to go on in the first place, the light will go off automatically, but may not extinguish right away: a set number of restarts may be required. So, patience, and a lack of urgency, are helpful.
I apologize for the tortured English that I've written, but I've been talking the lingo of the trade: in normal English, one does not "complete a monitor."
HT: Please correct me if I've said something that's not right.
Bottom line: Don't clear the dash light and then go take a smog test in California on the same day! I think that if you clear the light, you should drive for a couple of months, then take the car in for the test.