But what is the test for a Christian?
Two answers here:
Firstly, my personal view of the minimum requirements for somebody to be a Christian is that they worship a single deity and consider Jesus to be the messiah and the son of that deity. Exactly how they interpret the nature of God and what being his/her/its son entails is entirely up to them. How literally they take the Bible, whether they believe in Hell, what their views on homosexuality are and so on are secondary issues.
I also don't believe that immoral behaviour precludes you from being a Christian. After all, morality is at least somewhat determined by personal and societal values rather than an objective measurement and humans themselves are imperfect creatures. A popular Christian viewpoint is that everybody is a sinner.
Secondly, I just don't feel strongly enough about my minimum requirements that I would say, "No, you're not a Christian" to somebody who doesn't meet them. If they consider themselves a Christian, that's up to them and my own views on the matter really aren't that important. This is also honestly the only thing that matters as far as determining the difference between the 2.4 billion Christians and the 5.4 billion non-Christians. To vastly oversimplify the process of determining religious demographics, it essentially boils down to how many people said, "Yes, I'm a Christian" when asked (or at least, how many people do we predict would say yes).