The description of the function FcConfigSetCurrent states: "Sets the current default configuration to config". But after changing the font configuration, the function FcConfigSetCurrent doesn't make it as default configuration.
The detailed bug description can be found at:
I'm surprised it didn't just crash -- setting the config to the current value would have triggered a bug in the library. This should be fixed now (and do nothing). Your test is not checking the right thing; you should construct a new configuration (using FcConfigCreate or FcInitLoadConfig).