Skip to content

[KEMField] Test programs compile now without stopping the build process - #159

Merged
2xB merged 4 commits into
KATRIN-Experiment:mainfrom
danielfrh:danielfrh/Compilation
Oct 26, 2026
Merged

2xB merged 4 commits into
KATRIN-Experiment:mainfrom
danielfrh:danielfrh/Compilation

Conversation

@danielfrh

Copy link
Copy Markdown

Hi everyone!

Compilation errors occur with KEMField test programs. These errors can be solved through adding void statements incorporating if cnditions into existing switch statements.
Furthermore default values for TestDielectrics have been set.

In various test files counter variable i (will be used inside loop, compiler does not recognize):

error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
  370 |         unsigned int i = 0;

=> solved by adding "(void) i"

In addition following compilation error occurs:

error: result of comparison of constant -1 with expression of type 'char' is always false [-Werror,-Wtautological-constant-out-of-range-compare]

In these cases the if statement has been incorporated to the switch condition:

        if (optId == -1)
            break;

as

            case (-1):
                break;

Thanks,
Daniel

@2xB 2xB left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you very much for the Pull Request! I never looked into these applications - are they of any use? Should they be run as part of our test pipeline?

@2xB

2xB commented Sep 7, 2026

Copy link
Copy Markdown
Member

Looks great! Should we run these applications as part of our automatic test pipeline?
Also, if you know why they exist, should they get a small README and be linked in https://github.com/KATRIN-Experiment/Kassiopeia/blob/main/CONTRIBUTING.md?

@danielfrh

Copy link
Copy Markdown
Author

I think this pull request is interim.
After this, in a seperate pull request the existing test programs should be checked throughly anly the programs which are really needed and could help (new!) users should stay in the repo. What do you think this?

@2xB

2xB commented Oct 5, 2026

Copy link
Copy Markdown
Member

Somehow both this branch is locked from edit from maintainers and Pull Requests on your fork are locked, so I can't add the code myself. But I'd suggest adding -DKEMField_ENABLE_TEST=ON \ to the setup.sh file so these apps are part of our pre-built Docker distribution and their build remains tested as part of our CI pipeline.

@2xB

2xB commented Oct 5, 2026

Copy link
Copy Markdown
Member

After that, I'd suggest to merge this.

@2xB
2xB merged commit 561030c into KATRIN-Experiment:main Oct 26, 2026
6 checks passed
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