Add sparse_test.cc

This is just the C++ test.