Loading system/test/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ subdirs = [ "suite", ] filegroup { name: "TestMockAudioA2dp", srcs: ["mock/mock_audio_a2dp*.cc"], } filegroup { name: "TestMockBtaAg", srcs: [ Loading system/test/mock/mock_audio_a2dp_hw_utils.cc 0 → 100644 +67 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Generated mock file from original source file * Functions generated:2 * * mockcify.pl ver 0.6.1 */ // Mock include file to share data between tests and mock #include "test/mock/mock_audio_a2dp_hw_utils.h" #include "audio_a2dp_hw/include/audio_a2dp_hw.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any namespace test { namespace mock { namespace audio_a2dp_hw_utils { // Function state capture and return values, if needed struct audio_a2dp_hw_dump_ctrl_event audio_a2dp_hw_dump_ctrl_event; struct delay_reporting_enabled delay_reporting_enabled; } // namespace audio_a2dp_hw_utils } // namespace mock } // namespace test // Mocked function return values, if any namespace test { namespace mock { namespace audio_a2dp_hw_utils { const char* audio_a2dp_hw_dump_ctrl_event::return_value = nullptr; bool delay_reporting_enabled::return_value = false; } // namespace audio_a2dp_hw_utils } // namespace mock } // namespace test // Mocked functions, if any const char* audio_a2dp_hw_dump_ctrl_event(tA2DP_CTRL_CMD event) { inc_func_call_count(__func__); return test::mock::audio_a2dp_hw_utils::audio_a2dp_hw_dump_ctrl_event(event); } bool delay_reporting_enabled() { inc_func_call_count(__func__); return test::mock::audio_a2dp_hw_utils::delay_reporting_enabled(); } // Mocked functions complete // END mockcify generation system/test/mock/mock_audio_a2dp_hw_utils.h 0 → 100644 +69 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once /* * Generated mock file from original source file * Functions generated:2 * * mockcify.pl ver 0.6.1 */ #include <functional> // Original included files, if any // NOTE: Since this is a mock file with mock definitions some number of // include files may not be required. The include-what-you-use // still applies, but crafting proper inclusion is out of scope // for this effort. This compilation unit may compile as-is, or // may need attention to prune from (or add to ) the inclusion set. #include "audio_a2dp_hw/include/audio_a2dp_hw.h" // Original usings // Mocked compile conditionals, if any namespace test { namespace mock { namespace audio_a2dp_hw_utils { // Shared state between mocked functions and tests // Name: audio_a2dp_hw_dump_ctrl_event // Params: tA2DP_CTRL_CMD event // Return: const char* struct audio_a2dp_hw_dump_ctrl_event { static const char* return_value; std::function<const char*(tA2DP_CTRL_CMD event)> body{ [](tA2DP_CTRL_CMD event) { return return_value; }}; const char* operator()(tA2DP_CTRL_CMD event) { return body(event); }; }; extern struct audio_a2dp_hw_dump_ctrl_event audio_a2dp_hw_dump_ctrl_event; // Name: delay_reporting_enabled // Params: // Return: bool struct delay_reporting_enabled { static bool return_value; std::function<bool()> body{[]() { return return_value; }}; bool operator()() { return body(); }; }; extern struct delay_reporting_enabled delay_reporting_enabled; } // namespace audio_a2dp_hw_utils } // namespace mock } // namespace test // END mockcify generation Loading
system/test/Android.bp +5 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ subdirs = [ "suite", ] filegroup { name: "TestMockAudioA2dp", srcs: ["mock/mock_audio_a2dp*.cc"], } filegroup { name: "TestMockBtaAg", srcs: [ Loading
system/test/mock/mock_audio_a2dp_hw_utils.cc 0 → 100644 +67 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * Generated mock file from original source file * Functions generated:2 * * mockcify.pl ver 0.6.1 */ // Mock include file to share data between tests and mock #include "test/mock/mock_audio_a2dp_hw_utils.h" #include "audio_a2dp_hw/include/audio_a2dp_hw.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any namespace test { namespace mock { namespace audio_a2dp_hw_utils { // Function state capture and return values, if needed struct audio_a2dp_hw_dump_ctrl_event audio_a2dp_hw_dump_ctrl_event; struct delay_reporting_enabled delay_reporting_enabled; } // namespace audio_a2dp_hw_utils } // namespace mock } // namespace test // Mocked function return values, if any namespace test { namespace mock { namespace audio_a2dp_hw_utils { const char* audio_a2dp_hw_dump_ctrl_event::return_value = nullptr; bool delay_reporting_enabled::return_value = false; } // namespace audio_a2dp_hw_utils } // namespace mock } // namespace test // Mocked functions, if any const char* audio_a2dp_hw_dump_ctrl_event(tA2DP_CTRL_CMD event) { inc_func_call_count(__func__); return test::mock::audio_a2dp_hw_utils::audio_a2dp_hw_dump_ctrl_event(event); } bool delay_reporting_enabled() { inc_func_call_count(__func__); return test::mock::audio_a2dp_hw_utils::delay_reporting_enabled(); } // Mocked functions complete // END mockcify generation
system/test/mock/mock_audio_a2dp_hw_utils.h 0 → 100644 +69 −0 Original line number Diff line number Diff line /* * Copyright 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once /* * Generated mock file from original source file * Functions generated:2 * * mockcify.pl ver 0.6.1 */ #include <functional> // Original included files, if any // NOTE: Since this is a mock file with mock definitions some number of // include files may not be required. The include-what-you-use // still applies, but crafting proper inclusion is out of scope // for this effort. This compilation unit may compile as-is, or // may need attention to prune from (or add to ) the inclusion set. #include "audio_a2dp_hw/include/audio_a2dp_hw.h" // Original usings // Mocked compile conditionals, if any namespace test { namespace mock { namespace audio_a2dp_hw_utils { // Shared state between mocked functions and tests // Name: audio_a2dp_hw_dump_ctrl_event // Params: tA2DP_CTRL_CMD event // Return: const char* struct audio_a2dp_hw_dump_ctrl_event { static const char* return_value; std::function<const char*(tA2DP_CTRL_CMD event)> body{ [](tA2DP_CTRL_CMD event) { return return_value; }}; const char* operator()(tA2DP_CTRL_CMD event) { return body(event); }; }; extern struct audio_a2dp_hw_dump_ctrl_event audio_a2dp_hw_dump_ctrl_event; // Name: delay_reporting_enabled // Params: // Return: bool struct delay_reporting_enabled { static bool return_value; std::function<bool()> body{[]() { return return_value; }}; bool operator()() { return body(); }; }; extern struct delay_reporting_enabled delay_reporting_enabled; } // namespace audio_a2dp_hw_utils } // namespace mock } // namespace test // END mockcify generation