The X chromosome is known to play an important role in many sex-specific diseases. However, only a few single-nucleotide polymorphisms on the X chromosome have been found to be associated with diseases. Compared to the autosomes, conducting association tests on the X chromosome is more intractable due to the difference in the number of X chromosomes between females and males. On the other hand, X-chromosome inactivation takes place in female mammals, which is a phenomenon in which the expression of one copy of two X chromosomes in females is silenced in order to achieve the same gene expression level as that in males. In addition, imprinting effects may be related to certain diseases. Currently, there are some existing approaches taking X-chromosome inactivation into account when testing for associations on the X chromosome. However, none of them allows for imprinting effects. Therefore, in this paper, we propose a robust test, ZXCII, which accounts for both X-chromosome inactivation and imprinting effects without requiring specifying the genetic models in advance. Simulation studies are conducted in order to investigate the validity and performance of ZXCII under various scenarios of different parameter values. The simulation results show that ZXCII controls the type I error rate well when there is no association. Furthermore, with regards to power, ZXCII is robust in all of the situations considered and generally outperforms most of the existing methods in the presence of imprinting effects, especially under complete imprinting effects.