update C source and tests