Some BUILD_TESTING=1 fixes

Here are some BUILD_TESTING=1 fixes, I've disabled the test which relies on codeblock.proto