Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Write doctest tests for atomics.hpp #21

Closed
Tracked by #7
cinderbdt opened this issue Oct 31, 2021 · 2 comments
Closed
Tracked by #7

Write doctest tests for atomics.hpp #21

cinderbdt opened this issue Oct 31, 2021 · 2 comments
Assignees

Comments

@cinderbdt
Copy link
Collaborator

cinderbdt commented Oct 31, 2021

I need to understand how doctest works if we're going to use it for testing. I've cloned the repo and I'm looking through the examples.

@cinderbdt cinderbdt mentioned this issue Oct 31, 2021
4 tasks
@cinderbdt cinderbdt changed the title Write tests for atomics.hpp Write doctest tests for atomics.hpp Oct 31, 2021
@cinderbdt
Copy link
Collaborator Author

As far as I can tell, there isn't a way to write doctest cases for the header if it has no function declarations in it. Also, we don't really need them?

@dgpalmieri
Copy link
Owner

dgpalmieri commented Nov 19, 2021

I think that it should be as simple as rewriting the print statements you have to be more imperative + use the test framework. What I would do is get the original atomics.h, run your file over that, then make a copy of the test file and start converting using the sizes/outputs from your original file like this:

std::cout<< "size of short: " << sizeof (short) << std::endl; -->
REQUIRE(sizeof(short) == <original atomics output>);

Does that give you more of an idea/direction?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants