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

[string_resize][bug]fix resize #586

Merged
merged 2 commits into from
Jan 30, 2024
Merged

[string_resize][bug]fix resize #586

merged 2 commits into from
Jan 30, 2024

Conversation

qicosmos
Copy link
Collaborator

Why

fix resize because of a bug in gcc: https://stackoverflow.com/questions/76351500/unexpected-result-from-stdwstringresize-and-overwrite.

coro_http_client clear buffer when reset.

What is changing

Example

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                                                   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
include/ylt/coro_io/channel.hpp                                    9                 0   100.00%          54                 3    94.44%          10                 2    80.00%
include/ylt/coro_io/client_pool.hpp                               29                 1    96.55%         358                70    80.45%         140                52    62.86%
include/ylt/coro_io/coro_file.hpp                                 22                 2    90.91%         213                46    78.40%          56                21    62.50%
include/ylt/coro_io/coro_io.hpp                                   37                 1    97.30%         212                 9    95.75%           4                 0   100.00%
include/ylt/coro_io/detail/client_queue.hpp                       10                 1    90.00%          47                 1    97.87%          10                 1    90.00%
include/ylt/coro_io/io_context_pool.hpp                           34                 3    91.18%         198                13    93.43%          24                 5    79.17%
include/ylt/coro_io/rate_limiter.hpp                              11                 0   100.00%          83                 8    90.36%           8                 3    62.50%
include/ylt/coro_rpc/impl/common_service.hpp                       1                 0   100.00%           8                 0   100.00%           4                 0   100.00%
include/ylt/coro_rpc/impl/coro_connection.hpp                     25                 7    72.00%         267               131    50.94%          80                47    41.25%
include/ylt/coro_rpc/impl/coro_rpc_client.hpp                     20                 5    75.00%         166                18    89.16%          44                12    72.73%
include/ylt/coro_rpc/impl/coro_rpc_server.hpp                     12                 0   100.00%         174                16    90.80%          62                27    56.45%
include/ylt/coro_rpc/impl/errno.h                                 10                 3    70.00%          43                31    27.91%          26                13    50.00%
include/ylt/coro_rpc/impl/protocol/coro_rpc_protocol.hpp           6                 1    83.33%          83                26    68.67%          24                 9    62.50%
include/ylt/coro_rpc/impl/router.hpp                               5                 0   100.00%          93                17    81.72%          30                13    56.67%
include/ylt/easylog.hpp                                            8                 0   100.00%          41                 3    92.68%          12                 4    66.67%
include/ylt/easylog/appender.hpp                                  22                 0   100.00%         266                18    93.23%          88                26    70.45%
include/ylt/easylog/record.hpp                                    17                 0   100.00%         111                 4    96.40%          16                 2    87.50%
include/ylt/struct_pack.hpp                                        3                 2    33.33%          29                 7    75.86%           0                 0         -
include/ylt/struct_pack/calculate_size.hpp                         7                 0   100.00%         215                17    92.09%           6                 5    16.67%
include/ylt/struct_pack/derived_helper.hpp                         2                 2     0.00%           6                 6     0.00%           0                 0         -
include/ylt/struct_pack/endian_wrapper.hpp                         6                 3    50.00%          86                28    67.44%           2                 1    50.00%
include/ylt/struct_pack/error_code.hpp                             6                 6     0.00%          30                30     0.00%           0                 0         -
include/ylt/struct_pack/foreach_macro.h                            1                 1     0.00%           1                 1     0.00%           0                 0         -
include/ylt/struct_pack/md5_constexpr.hpp                          7                 7     0.00%          31                31     0.00%           0                 0         -
include/ylt/struct_pack/packer.hpp                                 9                 2    77.78%         385                27    92.99%          18                13    27.78%
include/ylt/struct_pack/reflection.hpp                             9                 6    33.33%         628                81    87.10%           0                 0         -
include/ylt/struct_pack/size_info.hpp                              2                 0   100.00%          10                 0   100.00%           0                 0         -
include/ylt/struct_pack/tuple.hpp                                  1                 1     0.00%           1                 1     0.00%           0                 0         -
include/ylt/struct_pack/type_calculate.hpp                        21                21     0.00%         473               473     0.00%           0                 0         -
include/ylt/struct_pack/type_id.hpp                                2                 2     0.00%         198               198     0.00%           0                 0         -
include/ylt/struct_pack/util.h                                     5                 3    40.00%          35                14    60.00%           4                 0   100.00%
include/ylt/struct_pack/varint.hpp                                 1                 1     0.00%           3                 3     0.00%           0                 0         -
include/ylt/util/concurrentqueue.h                                79                19    75.95%        1252               578    53.83%         292               162    44.52%
include/ylt/util/dragonbox.h                                      90                50    44.44%         735               388    47.21%          38                34    10.53%
include/ylt/util/dragonbox_to_chars.h                              6                 2    66.67%         440               381    13.41%          54                46    14.81%
include/ylt/util/expected.hpp                                     17                 3    82.35%          21                 3    85.71%           2                 0   100.00%
include/ylt/util/meta_string.hpp                                  10                 3    70.00%          46                23    50.00%           8                 0   100.00%
include/ylt/util/time_util.h                                      13                13     0.00%         156               156     0.00%           0                 0         -
src/coro_io/tests/main.cpp                                         1                 0   100.00%           1                 0   100.00%           0                 0         -
src/coro_io/tests/test_channel.cpp                                12                 0   100.00%         189                 0   100.00%          12                 0   100.00%
src/coro_io/tests/test_client_pool.cpp                            22                 0   100.00%         352                10    97.16%          30                 8    73.33%
src/coro_io/tests/test_corofile.cpp                               38                 2    94.74%         839               109    87.01%         102                29    71.57%
src/coro_io/tests/test_rate_limiter.cpp                            7                 0   100.00%          82                 0   100.00%          10                 2    80.00%
src/include/doctest.h                                            315               197    37.46%        2376              1564    34.18%        1356               984    27.43%

Files which contain no functions:
include/ylt/struct_pack/marco.h                                    0                 0         -           0                 0         -           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                            970               370    61.86%       11037              4543    58.84%        2572              1521    40.86%

Copy link

Code Coverage Report
for detail, goto summary download Artifacts

Filename                                                   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
include/ylt/coro_io/channel.hpp                                    9                 0   100.00%          54                 3    94.44%          10                 2    80.00%
include/ylt/coro_io/client_pool.hpp                               29                 1    96.55%         358                76    78.77%         140                55    60.71%
include/ylt/coro_io/coro_file.hpp                                 22                 2    90.91%         213                46    78.40%          56                21    62.50%
include/ylt/coro_io/coro_io.hpp                                   37                 1    97.30%         212                 9    95.75%           4                 0   100.00%
include/ylt/coro_io/detail/client_queue.hpp                       10                 1    90.00%          47                 1    97.87%          10                 1    90.00%
include/ylt/coro_io/io_context_pool.hpp                           34                 3    91.18%         198                13    93.43%          24                 5    79.17%
include/ylt/coro_io/rate_limiter.hpp                              11                 0   100.00%          83                 8    90.36%           8                 3    62.50%
include/ylt/coro_rpc/impl/common_service.hpp                       1                 0   100.00%           8                 0   100.00%           4                 0   100.00%
include/ylt/coro_rpc/impl/coro_connection.hpp                     25                 7    72.00%         267               131    50.94%          80                46    42.50%
include/ylt/coro_rpc/impl/coro_rpc_client.hpp                     20                 5    75.00%         166                18    89.16%          44                13    70.45%
include/ylt/coro_rpc/impl/coro_rpc_server.hpp                     12                 0   100.00%         174                16    90.80%          62                27    56.45%
include/ylt/coro_rpc/impl/errno.h                                 10                 3    70.00%          43                31    27.91%          26                13    50.00%
include/ylt/coro_rpc/impl/protocol/coro_rpc_protocol.hpp           6                 1    83.33%          83                26    68.67%          24                 9    62.50%
include/ylt/coro_rpc/impl/router.hpp                               5                 0   100.00%          93                17    81.72%          30                13    56.67%
include/ylt/easylog.hpp                                            8                 0   100.00%          41                 3    92.68%          12                 4    66.67%
include/ylt/easylog/appender.hpp                                  22                 0   100.00%         266                18    93.23%          88                26    70.45%
include/ylt/easylog/record.hpp                                    17                 0   100.00%         111                 4    96.40%          16                 2    87.50%
include/ylt/struct_pack.hpp                                        3                 2    33.33%          29                 7    75.86%           0                 0         -
include/ylt/struct_pack/calculate_size.hpp                         7                 0   100.00%         215                17    92.09%           6                 5    16.67%
include/ylt/struct_pack/derived_helper.hpp                         2                 2     0.00%           6                 6     0.00%           0                 0         -
include/ylt/struct_pack/endian_wrapper.hpp                         6                 3    50.00%          86                28    67.44%           2                 1    50.00%
include/ylt/struct_pack/error_code.hpp                             6                 6     0.00%          30                30     0.00%           0                 0         -
include/ylt/struct_pack/foreach_macro.h                            1                 1     0.00%           1                 1     0.00%           0                 0         -
include/ylt/struct_pack/md5_constexpr.hpp                          7                 7     0.00%          31                31     0.00%           0                 0         -
include/ylt/struct_pack/packer.hpp                                 9                 2    77.78%         385                27    92.99%          18                13    27.78%
include/ylt/struct_pack/reflection.hpp                             9                 6    33.33%         628                81    87.10%           0                 0         -
include/ylt/struct_pack/size_info.hpp                              2                 0   100.00%          10                 0   100.00%           0                 0         -
include/ylt/struct_pack/tuple.hpp                                  1                 1     0.00%           1                 1     0.00%           0                 0         -
include/ylt/struct_pack/type_calculate.hpp                        21                21     0.00%         473               473     0.00%           0                 0         -
include/ylt/struct_pack/type_id.hpp                                2                 2     0.00%         198               198     0.00%           0                 0         -
include/ylt/struct_pack/util.h                                     5                 3    40.00%          35                14    60.00%           4                 0   100.00%
include/ylt/struct_pack/varint.hpp                                 1                 1     0.00%           3                 3     0.00%           0                 0         -
include/ylt/util/concurrentqueue.h                                79                19    75.95%        1252               578    53.83%         292               163    44.18%
include/ylt/util/dragonbox.h                                      90                50    44.44%         735               388    47.21%          38                34    10.53%
include/ylt/util/dragonbox_to_chars.h                              6                 2    66.67%         440               381    13.41%          54                46    14.81%
include/ylt/util/expected.hpp                                     17                 3    82.35%          21                 3    85.71%           2                 0   100.00%
include/ylt/util/meta_string.hpp                                  10                 3    70.00%          46                23    50.00%           8                 0   100.00%
include/ylt/util/time_util.h                                      13                13     0.00%         156               156     0.00%           0                 0         -
src/coro_io/tests/main.cpp                                         1                 0   100.00%           1                 0   100.00%           0                 0         -
src/coro_io/tests/test_channel.cpp                                12                 0   100.00%         189                 0   100.00%          12                 0   100.00%
src/coro_io/tests/test_client_pool.cpp                            22                 0   100.00%         352                10    97.16%          30                 8    73.33%
src/coro_io/tests/test_corofile.cpp                               38                 2    94.74%         839               109    87.01%         102                29    71.57%
src/coro_io/tests/test_rate_limiter.cpp                            7                 0   100.00%          82                 0   100.00%          10                 2    80.00%
src/include/doctest.h                                            315               197    37.46%        2376              1564    34.18%        1356               984    27.43%

Files which contain no functions:
include/ylt/struct_pack/marco.h                                    0                 0         -           0                 0         -           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                            970               370    61.86%       11037              4549    58.78%        2572              1525    40.71%

@qicosmos qicosmos merged commit 06103b5 into alibaba:main Jan 30, 2024
32 checks passed
@qicosmos qicosmos deleted the fix_resize branch January 30, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant