fix compilation error on mac: we should not assign C++ flags to C compiler
add more unit test case for ByteBuffer