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

Fix C++ unit tests #118

Merged
merged 4 commits into from Jan 7, 2020
Merged

Fix C++ unit tests #118

merged 4 commits into from Jan 7, 2020

Conversation

trevor-vincent
Copy link
Contributor

Context:

Normal distribution deviates are picked from N(0,1) to create random matrices in the unit tests. The unit tests were accidentally using N(1,0) instead which just creates matrices with only ones.

Description of the Change:

Change N(1,0) to N(0,1) everywhere in the unit tests and enforce symmetry of matrices in unit tests.
AllOneRpt unit tests only need matrices with only ones, so the random number generation was removed.

Benefits:

Tests now use random matrices

Possible Drawbacks:

Formatting of the code has changed slightly. Should I run this through clang-tidy?

Related GitHub Issues:

@trevor-vincent trevor-vincent changed the title Fix tests Fix C++ unit tests Jan 6, 2020
Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this @trevor-vincent! We've actually been using astyle for formatting, but perhaps it should be better to start using clang-tidy instead.

@codecov
Copy link

codecov bot commented Jan 6, 2020

Codecov Report

Merging #118 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #118   +/-   ##
=======================================
  Coverage   97.75%   97.75%           
=======================================
  Files          12       12           
  Lines         891      891           
=======================================
  Hits          871      871           
  Misses         20       20

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 de39674...accb8e4. Read the comment docs.

@nquesada
Copy link
Collaborator

nquesada commented Jan 6, 2020

This is great. Thanks for fixing improving the tests @trevor-vincent . Any reason why we should change the formatting? Is one of them more "consistent" with PEPE8?

@trevor-vincent
Copy link
Contributor Author

Thank you guys. No reason for the formatting change, It was accidental. I will run astyle through it, push the changes and squash the commits later whenever the pull request is ready.

used clang-format --style=Google
@josh146 josh146 merged commit df12c28 into XanaduAI:master Jan 7, 2020
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.

None yet

3 participants