Skip to content

Replace assert() with baselibs futurecpp assert macros#279

Merged
NicolasFussberger merged 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/replace_assert_with_baselibs_macros
Jul 6, 2026
Merged

Replace assert() with baselibs futurecpp assert macros#279
NicolasFussberger merged 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/replace_assert_with_baselibs_macros

Conversation

@shegazyy

@shegazyy shegazyy commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Replaces all 37 plain assert() calls across 10 source files with the appropriate SCORE_LANGUAGE_FUTURECPP_* macros from score/assert.hpp, as required by project guidelines. Also adds the explicit @score_baselibs//score/language/futurecpp dep to 7 Bazel targets that now directly depend on the assert header.

Macro selection follows existing codebase convention:

  • PRECONDITION[_PRD][_MESSAGE] for constructor/function-entry argument checks
  • ASSERT_PRD[_MESSAGE] for mid-function invariants in the safety-critical daemon
  • Default-level PRECONDITION (no PRD) for health_monitor, matching sibling files

The _PRD variants guarantee checks survive any future NDEBUG or ASSERT_LEVEL_PRODUCTION build configuration, which is appropriate for the alive_monitor daemon (AUTOSAR PHM code referencing SWS_PHM_00204).

Closes #263

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 24e4d9c3-1221-483a-8f30-6f31f0ba297d
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (31 packages loaded, 10 targets configured)

Analyzing: target //:license-check (81 packages loaded, 10 targets configured)

Analyzing: target //:license-check (143 packages loaded, 1051 targets configured)

Analyzing: target //:license-check (152 packages loaded, 5510 targets configured)

Analyzing: target //:license-check (152 packages loaded, 8172 targets configured)

Analyzing: target //:license-check (157 packages loaded, 8229 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[9 / 16] [Prepa] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes ... (3 actions, 0 running)
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 24.064s, Critical Path: 2.56s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@shegazyy shegazyy force-pushed the fix/replace_assert_with_baselibs_macros branch from 2addcde to 958cd87 Compare July 1, 2026 12:38
@shegazyy shegazyy requested a deployment to workflow-approval July 1, 2026 12:38 — with GitHub Actions Waiting
@shegazyy shegazyy requested a deployment to workflow-approval July 1, 2026 12:38 — with GitHub Actions Waiting
@shegazyy shegazyy force-pushed the fix/replace_assert_with_baselibs_macros branch from 958cd87 to 12bd5f5 Compare July 1, 2026 12:57
@shegazyy shegazyy requested a deployment to workflow-approval July 1, 2026 12:57 — with GitHub Actions Waiting
@shegazyy shegazyy requested a deployment to workflow-approval July 1, 2026 12:57 — with GitHub Actions Waiting
Replaces all 37 plain assert() calls across 10 source files with the
appropriate SCORE_LANGUAGE_FUTURECPP_* macros from score/assert.hpp,
as required by project guidelines. Also adds the explicit
@score_baselibs//score/language/futurecpp dep to 7 Bazel targets that
now directly depend on the assert header.

Macro selection follows existing codebase convention:
- PRECONDITION[_PRD][_MESSAGE] for constructor/function-entry argument checks
- ASSERT_PRD[_MESSAGE] for mid-function invariants in the safety-critical daemon
- Default-level PRECONDITION (no PRD) for health_monitor, matching sibling files

The _PRD variants guarantee checks survive any future NDEBUG or
ASSERT_LEVEL_PRODUCTION build configuration, which is appropriate for
the alive_monitor daemon (AUTOSAR PHM code referencing SWS_PHM_00204).

Closes eclipse-score#263
@shegazyy shegazyy force-pushed the fix/replace_assert_with_baselibs_macros branch from 12bd5f5 to a17ad6c Compare July 5, 2026 11:38
@shegazyy shegazyy temporarily deployed to workflow-approval July 5, 2026 11:38 — with GitHub Actions Inactive
@shegazyy shegazyy temporarily deployed to workflow-approval July 5, 2026 11:38 — with GitHub Actions Inactive
@shegazyy

shegazyy commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Hey @NicolasFussberger 🙏 this closes out #263, replaced all 37 plain assert() calls with the right baselibs futurecpp macros across the 10 files. Would love a review whenever you get a chance!

@NicolasFussberger

Copy link
Copy Markdown
Contributor

Hey @NicolasFussberger 🙏 this closes out #263, replaced all 37 plain assert() calls with the right baselibs futurecpp macros across the 10 files. Would love a review whenever you get a chance!

Thanks a lot @shegazyy, I will do a review

@NicolasFussberger NicolasFussberger merged commit 773b3a1 into eclipse-score:main Jul 6, 2026
21 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in LCM - Lifecycle & Health FT Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Replace default asserts with baselibs assert macros

3 participants