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: Add more testcases for previously untested code #317

Merged
merged 9 commits into from
Jul 6, 2020
Merged

Conversation

Swatinem
Copy link
Member

@Swatinem Swatinem commented Jun 24, 2020

Tests added:

  • Object cloning and overwriting keys.
  • Serializing more msgpack values.
  • Forcing captured events to have a uuid event_id.
  • JSON escapes and surrogate parsing, also fixing a bug for that.
  • Discarding events when missing consent.
  • Test and fix recording errors on current session.
  • Sessions with username did.
  • Lots of abnormal sessions on startup.

Bugs fixed:

  • Wrong JSON decoding with surrogate pairs.
  • Memory Leak parsing unmatched surrogate pairs.
  • Never recorded error counts on sessions.

@Swatinem Swatinem requested a review from a team June 24, 2020 10:16
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2020

Codecov Report

Merging #317 into master will increase coverage by 2.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #317      +/-   ##
==========================================
+ Coverage   85.03%   87.18%   +2.15%     
==========================================
  Files          49       49              
  Lines        3975     3971       -4     
==========================================
+ Hits         3380     3462      +82     
+ Misses        595      509      -86     
Impacted Files Coverage Δ
src/sentry_core.c 94.40% <100.00%> (+3.49%) ⬆️
src/sentry_json.c 88.13% <100.00%> (+12.70%) ⬆️
src/sentry_path.h 20.00% <0.00%> (-20.00%) ⬇️
src/symbolizer/sentry_symbolizer_unix.c 91.66% <0.00%> (-8.34%) ⬇️
src/sentry_options.c 77.55% <0.00%> (-0.23%) ⬇️
src/sentry_sync.h 97.29% <0.00%> (-0.08%) ⬇️
src/sentry_utils.c 90.07% <0.00%> (-0.04%) ⬇️
src/sentry_scope.c 98.26% <0.00%> (+0.57%) ⬆️
src/sentry_session.c 90.32% <0.00%> (+1.93%) ⬆️
src/sentry_database.c 82.26% <0.00%> (+2.12%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4adf9c3...b963723. Read the comment docs.

@Swatinem
Copy link
Member Author

The failing test (memory leak) is totally expected and is fixed in #304

examples/example.c Outdated Show resolved Hide resolved
tests/unit/test_value.c Show resolved Hide resolved
@Swatinem Swatinem merged commit 577c9f4 into master Jul 6, 2020
@Swatinem Swatinem deleted the test/cover branch July 6, 2020 17:43
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.

4 participants