From 2178081cd90ebcd77c867d52a8b0e15f0d4134cc Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 11 Sep 2020 01:29:45 +0000 Subject: Use AIDL_* errors over libbase logging. This: - gives us line numbers in source AIDL files reflecting errors - makes it possible aidl_parser_fuzzer can detect when we return an error but don't provide any output logging Bug: N/A Test: aidl_unittest Change-Id: I0479fd8d87547c1f0b1be754f9b8f6865db3cbef --- aidl_checkapi.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'aidl_checkapi.cpp') diff --git a/aidl_checkapi.cpp b/aidl_checkapi.cpp index a0107e41..0f2f4b02 100644 --- a/aidl_checkapi.cpp +++ b/aidl_checkapi.cpp @@ -127,7 +127,7 @@ static bool are_compatible_interfaces(const AidlInterface& older, const AidlInte const auto& old_args = old_m->GetArguments(); const auto& new_args = new_m->GetArguments(); // this is guaranteed because arguments are part of AidlMethod::Signature() - CHECK(old_args.size() == new_args.size()); + AIDL_FATAL_IF(old_args.size() != new_args.size(), old_m); for (size_t i = 0; i < old_args.size(); i++) { const AidlArgument& old_a = *(old_args.at(i)); const AidlArgument& new_a = *(new_args.at(i)); @@ -317,9 +317,10 @@ static Result load_from_dir(const Options& options, const IoDeleg } bool check_api(const Options& options, const IoDelegate& io_delegate) { - CHECK(options.IsStructured()); - CHECK(options.InputFiles().size() == 2) << "--checkapi requires two inputs " - << "but got " << options.InputFiles().size(); + AIDL_FATAL_IF(!options.IsStructured(), AIDL_LOCATION_HERE); + AIDL_FATAL_IF(options.InputFiles().size() != 2, AIDL_LOCATION_HERE) + << "--checkapi requires two inputs " + << "but got " << options.InputFiles().size(); auto old_tns = load_from_dir(options, io_delegate, options.InputFiles().at(0)); if (!old_tns.ok()) { return false; -- cgit v1.2.3