Husband testing me?

My husband tonight suddenly says he’s not happy in our marriage. I was shocked so I said I’m sorry did I hear you right, your not happy? He nodded his head and said yes. I said okay well I don’t know why but if you are not happy then why are we together. He suddenly completely switches and says no I was just testing you and I wanted to see what you would say and then he starts telling me how much he loves me. This is weird right? does he feel guilty or something? I’m so confused