Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

fix: complete test coverage for g:c:spanner::Timestamp #1190

Merged
merged 1 commit into from
Jan 11, 2020

Conversation

devbww
Copy link
Contributor

@devbww devbww commented Jan 11, 2020

  • Add test cases for some previously unexercised code paths
  • Remove one always-unreachable overflow-detection code path
  • Another overflow-detection code path is unreachable when
    tm_year is only 32-bits (which is usually the case), so we
    can't hit 100% coverage
  • Fix one bug with creating a Timestamp from a time_point
    with sub-nanosecond precision, and add test case.

This change is Reviewable

* Add test cases for some previously unexercised code paths
* Remove one always-unreachable overflow-detection code path
* Another overflow-detection code path is unreachable when
  tm_year is only 32-bits (which is usually the case), so we
  can't hit 100% coverage
* Fix one bug with creating a `Timestamp` from a `time_point`
  with sub-nanosecond precision, and add test case.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 11, 2020
@codecov
Copy link

codecov bot commented Jan 11, 2020

Codecov Report

Merging #1190 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1190      +/-   ##
==========================================
+ Coverage   95.63%   95.69%   +0.06%     
==========================================
  Files         175      175              
  Lines       13570    13598      +28     
==========================================
+ Hits        12977    13012      +35     
+ Misses        593      586       -7
Impacted Files Coverage Δ
google/cloud/spanner/timestamp.cc 98.94% <100%> (+4.82%) ⬆️
google/cloud/spanner/timestamp_test.cc 100% <100%> (ø) ⬆️
...loud/spanner/internal/partial_result_set_resume.cc 90.9% <0%> (-4.55%) ⬇️
google/cloud/spanner/internal/polling_loop.h 91.89% <0%> (-2.71%) ⬇️
...ud/spanner/integration_tests/client_stress_test.cc 81.57% <0%> (-1.76%) ⬇️
...loud/spanner/internal/partial_result_set_source.cc 93.24% <0%> (-1.36%) ⬇️
google/cloud/spanner/internal/spanner_stub.cc 69.23% <0%> (-1.1%) ⬇️
google/cloud/spanner/client.cc 96.55% <0%> (-0.87%) ⬇️
...on_tests/rpc_failure_threshold_integration_test.cc 85.55% <0%> (-0.16%) ⬇️
google/cloud/spanner/keys.h 100% <0%> (ø) ⬆️
... and 4 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 0d11969...d73d27c. Read the comment docs.

@devbww devbww requested review from devjgm, coryan and mr-salty January 11, 2020 08:16
@coryan coryan marked this pull request as ready for review January 11, 2020 14:38
@devbww devbww merged commit bf141b4 into googleapis:master Jan 11, 2020
@devbww devbww deleted the timestamp-coverage branch January 11, 2020 17:50
devjgm pushed a commit to devjgm/google-cloud-cpp that referenced this pull request May 7, 2020
…ogle-cloud-cpp-spanner#1190)

* Add test cases for some previously unexercised code paths
* Remove one always-unreachable overflow-detection code path
* Another overflow-detection code path is unreachable when
  tm_year is only 32-bits (which is usually the case), so we
  can't hit 100% coverage
* Fix one bug with creating a `Timestamp` from a `time_point`
  with sub-nanosecond precision, and add test case.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants