1. As someone else here pointed out, a computer can be programmed to pass the mirror test, indeed a sophisticated robot must be able to do this, to be able to successfully navigate a complex environment. But that robot need not be conscious to do so.
2. A conscious creature (a creature that shows classic signs of being conscious) isn't necessarily able to pass the mirror test. In this article --
http://en.wikipedia.org/wiki/Mirror_test
-- we read that "Primates, other than the great apes, have so far universally failed the mirror test." I think many primates would meet various criteria for consciousness, but can't pass the mirror test.
Interestingly, in the linked article, birds of the family Corvidae (crows, ravens, European magpies, gray jays (aka "camp robbers"), and others) pass the mirror test, possibly the only bird type that can. Corvids are very smart birds.