upstream changes for test/cctest/test-api.cc