Skip to content

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

Open
danielfrh wants to merge 3 commits into
KATRIN-Experiment:mainfrom
danielfrh:danielfrh/Compilation
Open

[KEMField] Test programs compile now without stopping the build process#159
danielfrh wants to merge 3 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?

Comment thread KEMField/Source/Applications/Test/TestDielectrics.cc Outdated
@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?

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