I agree, your vehicle is looking for certain sensors to become ready. If you recently disconnected the battery or cleared the ECU with a scanner, you will need to perform a drive cycle and/or emission readiness monitor(s), before you can pass your smog test. Like boofoo suggested, simply drive the car more, like you normally would. It sometimes helps if you can take it on the highway or find an open road.