A laser printer having a self-diagnostic function includes a first sensing
unit that changes in detection status when one of a process cartridge and
an inspection cartridge is mounted therein, and a second sensing unit
that changes in detection status when at least the other of the process
cartridge and inspection cartridge is mounted therein. A control unit of
the laser printer identifies the type of cartridge mounted in the laser
printer based on detection results from the first and second sensing
units and switches the operating mode of the laser printer from a normal
mode for performing image-forming operations to a self-diagnostic mode
for diagnosing the status of its components when the control unit
determines that the inspection cartridge is mounted in the laser printer.