Skip to content

Increase test coverage #4665

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

beutlich
Copy link
Member

No description provided.

@beutlich beutlich added this to the maintenance milestone Jun 19, 2025
@@ -4,8 +4,23 @@
#include <assert.h>
#include <string.h>

typedef enum {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it have made more sense to move the other ModelicaFileType declaration from ModelicaInternal.c to ModelicaInternal.h and re-use that?

Basically, I don't like such code duplication.

Copy link
Contributor

@HansOlsson HansOlsson left a comment

Choose a reason for hiding this comment

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

The general idea is good, but:

  • Would like some feedback on the enum.
  • In case an assert triggers the program will not clean up afterwards. Fixing that would be complicated, as the used primitives (e.g., ModelicaInternal_mkdir) can also fail. Just a comment saying that in case the test fails you should delete directories abc and xyz before attempting again might suffice.

@beutlich
Copy link
Member Author

beutlich commented Aug 4, 2025

The general idea is good, but:

* Would like some feedback on the enum.

I am not sure if ModelicaFileType is meant to be public. For testability I simply copied it.

* In case an assert triggers the program will not clean up afterwards. Fixing that would be complicated, as the used primitives (e.g., ModelicaInternal_mkdir) can also fail. Just a comment saying that in case the test fails you should delete directories abc and xyz before attempting again might suffice.

Indeed, the current testing setup is not good enough and does not support initialization or cleanup steps. A proper testing framework (e.g. Modelica_DeviveDrivers and ModelicaTableAdditions use GoogleTest) might solve the issue. But this is out of scope of this PR.

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.

2 participants