Add more thorough testing to test.cpp