Skip to content

Do not copy FILE objects#63

Closed
Inkrementator wants to merge 1 commit intoexoticlibraries:mainfrom
Inkrementator:main
Closed

Do not copy FILE objects#63
Inkrementator wants to merge 1 commit intoexoticlibraries:mainfrom
Inkrementator:main

Conversation

@Inkrementator
Copy link
Copy Markdown
Contributor

Fixes error in Android, where FILE is only accessible as opaque type and therefore fails to compile with incomplete type error.
Code now complies with: FIO38-C. Do not copy a FILE object, See: https://wiki.sei.cmu.edu/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object

Fixes error in Android where FILE is only accessible as opaque type.
Code now complies with: FIO38-C. Do not copy a FILE object, See:
https://wiki.sei.cmu.edu/confluence/display/c/FIO38-C.+Do+not+copy+a+FILE+object
@Thecarisma
Copy link
Copy Markdown
Member

Thecarisma commented Sep 23, 2022

FILE object is copied so a temporary FILE can be used for std output and input streams testing, and at the end of each test case the captured FILE object are reverted back to the original values.
By disabling the FILE object copy testing involving assertions on the output streams will stop working.

The best approach I can think of now is to add a macro that will exclude the FILE capture feature during compilation and the flag to exclude the feature at runtime:

CESTER_NO_STREAM_CAPTURE
--cester-nostreamcapture

@Thecarisma
Copy link
Copy Markdown
Member

I will make an update to the framework to selectively compile FILE capturing feature

@Inkrementator
Copy link
Copy Markdown
Contributor Author

Thanks, interesting. Why provide a runtime flag though?

@chenyulue
Copy link
Copy Markdown

Issue 65 may be an alternative solution to the error in Android.

@Thecarisma
Copy link
Copy Markdown
Member

Thanks, interesting. Why provide a runtime flag though?

I provide an alternate runtime flag, in in case the feature wants to exclude after the test has been compiled.

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.

3 participants