-
Notifications
You must be signed in to change notification settings - Fork 21
PR to get the latest code coverage #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Copyright 2020 Comcast Cable Communications Management, LLC | ||
|
Check failure on line 2 in source/test/bulkdata/profileMock.cpp
|
||
| * | ||
| * 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. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| #include <stdbool.h> | ||
| #include <cjson/cJSON.h> | ||
| #include "vector.h" | ||
| #include "msgpack.h" | ||
| #include "test/bulkdata/profileMock.h" | ||
|
|
||
|
|
||
| //protocol mock functions | ||
| extern "C" T2ERROR __wrap_sendReportOverHTTP(char *httpUrl, char *payload) | ||
| { | ||
| if(!g_profileMock) | ||
| { | ||
| return T2ERROR_FAILURE; | ||
| } | ||
| // No mock function needed, just a stub | ||
| return g_profileMock->sendReportOverHTTP(httpUrl, payload); | ||
| } | ||
|
|
||
| extern "C" T2ERROR __wrap_sendCachedReportsOverHTTP(char *httpUrl, Vector *reportList) | ||
| { | ||
| if(!g_profileMock) | ||
| { | ||
| return T2ERROR_FAILURE; | ||
| } | ||
| // No mock function needed, just a stub | ||
| return g_profileMock->sendCachedReportsOverHTTP(httpUrl, reportList); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| * Copyright 2020 Comcast Cable Communications Management, LLC | ||
|
Check failure on line 2 in source/test/bulkdata/profileMock.h
|
||
| * | ||
| * 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. | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| //#ifndef SOURCE_TEST_MOCKS_SYSTEMMOCK_H_ | ||
| //#define SOURCE_TEST_MOCKS_SYSTEMMOCK_H_ | ||
|
|
||
| #include <gtest/gtest.h> | ||
| #include <gmock/gmock.h> | ||
| #include "telemetry2_0.h" | ||
|
|
||
|
|
||
| class profileMock | ||
| { | ||
| public: | ||
|
|
||
| MOCK_METHOD(T2ERROR, sendReportOverHTTP, (char *httpUrl, char *payload), ()); | ||
| MOCK_METHOD(T2ERROR, sendCachedReportsOverHTTP, (char *httpUrl, Vector *reportList), ()); | ||
| }; | ||
|
|
||
| extern profileMock *g_profileMock; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code should be removed. If this code is not needed, it should be deleted rather than left as a comment. Version control systems can track historical code if needed.