Skip to content
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

test(publisher): unit test #301

Merged
merged 4 commits into from
Nov 25, 2024
Merged

test(publisher): unit test #301

merged 4 commits into from
Nov 25, 2024

Conversation

atsushi421
Copy link
Contributor

@atsushi421 atsushi421 commented Nov 25, 2024

Description

Publisherへの単体テストを実装しました。このバグへの対応や、returnしているだけだった部分をexitするように実装も変更しています。#297 と同様の理由で、Mockする関数群をnamespace agnocastの外に出しています。

Related links

How was this PR tested?

  • sample application (required)
  • pass unit test

Notes for reviewers

見落としている使われ方ありそうなら教えてください

@veqcc veqcc added the run-build-test Run build-test in CI label Nov 25, 2024
Copy link

------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: .
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
build/agnocastlib/_deps/gmock-global-src/include/gmock-global/gmock-global.h
                                               4       4   100%   
src/agnocastlib/include/agnocast.hpp           2       2   100%   
src/agnocastlib/include/agnocast_executor.hpp
                                               1       0     0%   38
src/agnocastlib/include/agnocast_publisher.hpp
                                              24      19    79%   68-69,78-80
src/agnocastlib/include/agnocast_smart_pointer.hpp
                                              48      48   100%   
src/agnocastlib/include/agnocast_topic_info.hpp
                                              13      13   100%   
src/agnocastlib/src/agnocast.cpp              80      15    18%   22,24,27,30,32-34,36,39,42,44-49,53-54,57-61,65-66,70-73,76,79,81-84,87,90,92-93,95-96,101,103-105,108-111,114,117-122,124,137-138,149-150,153-155,160
src/agnocastlib/src/agnocast_component_container.cpp
                                               8       0     0%   5,7,9-10,12-13,15-16
src/agnocastlib/src/agnocast_component_container_mt.cpp
                                              27       0     0%   7,9,11-15,18,20-21,24-25,28-29,32-34,37-39,43-44,46-48,50-51
src/agnocastlib/src/agnocast_executor.cpp
                                              82       0     0%   10,12,14-16,18-20,24,26,29,31-32,35-39,42-45,47-48,52-53,55-58,61-62,67,73,75-79,82,86-87,90-91,94,96-100,103,109-114,117,121-123,125-128,131,133-135,138,140,143,147-148,151-154,157,160,162-163
src/agnocastlib/src/agnocast_multi_threaded_executor.cpp
                                              49       0     0%   9,13,15-16,18-19,24-25,28-32,35,37-40,43,47,50,52-54,57-59,63,65-66,70,73,76,78-79,81-82,86-87,90,95,99,102-103,106,113-115,118
src/agnocastlib/src/agnocast_publisher.cpp
                                              66       0     0%   5,7,10-15,19-20,27,32,34-39,43-49,54,59-65,68-69,71,73-74,76-79,81,85,89-90,96,101-109,112-113,116,119,122-126,129
src/agnocastlib/src/agnocast_single_threaded_executor.cpp
                                              18       0     0%   10-12,16,18-21,24,28-30,33,35-36,39-41
src/agnocastlib/src/agnocast_smart_pointer.cpp
                                              18       0     0%   5,8-15,19,22-29
src/agnocastlib/src/agnocast_subscription.cpp
                                              83       9    10%   10-12,14,17,21,24-26,28,30,32,35-38,40-44,46,49-50,52-56,59-62,64,66,69,72,77-79,81-87,90-91,98,103,105-108,111,114,118,120-123,125-129,131,133,136,140-141,143-144
src/agnocastlib/src/agnocast_topic_info.cpp
                                              14       0     0%   12,20-24,28-31,34-37
src/agnocastlib/src/agnocast_utils.cpp        23      21    91%   46,48
src/agnocastlib/test/test_agnocast_publisher.cpp
                                              41      41   100%   
src/agnocastlib/test/test_agnocast_smart_pointer.cpp
                                              99      99   100%   
src/agnocastlib/test/test_agnocast_subscription.cpp
                                              23      23   100%   
src/agnocastlib/test/test_agnocast_topic_info.cpp
                                              19      18    94%   31
src/agnocastlib/test/test_agnocast_utils.cpp
                                              32      32   100%   
------------------------------------------------------------------------------
TOTAL                                        774     344    44%
------------------------------------------------------------------------------

@atsushi421 atsushi421 merged commit 012c37e into main Nov 25, 2024
4 checks passed
@atsushi421 atsushi421 deleted the unit_test_for_publisher branch November 25, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-build-test Run build-test in CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants