trusty: fuzz: Explicit errors instead of asserts
Bug: 171750250 Test: m \ trusty_test_fuzzer \ trusty_gatekeeper_fuzzer \ trusty_keymaster_fuzzer \ trusty_confirmationui_fuzzer Change-Id: Ib22cf72b2db7b991e716c0116ca57d3f77459ada
This commit is contained in:
parent
3c651c278c
commit
2c56d833c5
|
@ -14,10 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#undef NDEBUG
|
||||
|
||||
#include <assert.h>
|
||||
#include <log/log.h>
|
||||
#include <iostream>
|
||||
#include <stdlib.h>
|
||||
#include <trusty/coverage/coverage.h>
|
||||
#include <trusty/fuzz/counters.h>
|
||||
|
@ -52,7 +49,10 @@ static CoverageRecord record(TIPC_DEV, &confirmationui_uuid);
|
|||
|
||||
extern "C" int LLVMFuzzerInitialize(int* /* argc */, char*** /* argv */) {
|
||||
auto ret = record.Open();
|
||||
assert(ret.ok());
|
||||
if (!ret.ok()) {
|
||||
std::cerr << ret.error() << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,15 +14,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#undef NDEBUG
|
||||
|
||||
#include <assert.h>
|
||||
#include <log/log.h>
|
||||
#include <stdlib.h>
|
||||
#include <trusty/coverage/coverage.h>
|
||||
#include <trusty/fuzz/counters.h>
|
||||
#include <trusty/fuzz/utils.h>
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
|
||||
using android::trusty::coverage::CoverageRecord;
|
||||
using android::trusty::fuzz::ExtraCounters;
|
||||
|
@ -43,7 +40,10 @@ static CoverageRecord record(TIPC_DEV, &test_srv_uuid);
|
|||
|
||||
extern "C" int LLVMFuzzerInitialize(int* /* argc */, char*** /* argv */) {
|
||||
auto ret = record.Open();
|
||||
assert(ret.ok());
|
||||
if (!ret.ok()) {
|
||||
std::cerr << ret.error() << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,15 +14,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#undef NDEBUG
|
||||
|
||||
#include <assert.h>
|
||||
#include <log/log.h>
|
||||
#include <stdlib.h>
|
||||
#include <trusty/coverage/coverage.h>
|
||||
#include <trusty/fuzz/counters.h>
|
||||
#include <trusty/fuzz/utils.h>
|
||||
#include <unistd.h>
|
||||
#include <iostream>
|
||||
|
||||
using android::trusty::coverage::CoverageRecord;
|
||||
using android::trusty::fuzz::ExtraCounters;
|
||||
|
@ -44,7 +41,10 @@ static CoverageRecord record(TIPC_DEV, &gatekeeper_uuid, GATEKEEPER_MODULE_NAME)
|
|||
|
||||
extern "C" int LLVMFuzzerInitialize(int* /* argc */, char*** /* argv */) {
|
||||
auto ret = record.Open();
|
||||
assert(ret.ok());
|
||||
if (!ret.ok()) {
|
||||
std::cerr << ret.error() << std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,10 +14,6 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#undef NDEBUG
|
||||
|
||||
#include <assert.h>
|
||||
#include <log/log.h>
|
||||
#include <stdlib.h>
|
||||
#include <trusty/coverage/coverage.h>
|
||||
#include <trusty/fuzz/counters.h>
|
||||
|
|
Loading…
Reference in New Issue