Soft (pending) trouble codes... The short answer is yes. Your vehicle can pass the smog check with a pending trouble code, so long as the check engine light is not illuminated and the required emission monitors are ready.
A pending trouble code may set for diagnostic purposes and will not illuminate the check engine light. Pending codes can be set for many different reasons and that does not mean the component in question is likely to fail soon. Your vehicle's ECM may have noticed an irregular input and will continue to monitor the system to see if the irregularity is permanent.
Hard (confirmed) trouble codes... After 3 consecutive drive cycles, when the ECM no longer detects a fault(s), the MIL (malfunction indicator lamp/check engine light) will turn off.
Pending Trouble Code Clearance... Type A code - Code will remain pending until 80 warm up cycles. Type B code - Code will remain pending until 40 warm up cycles.