move tests to test.cc (and use picotest)