Skip to content

Replace assert() with baselibs futurecpp assert macros#279

Open
shegazyy wants to merge 1 commit into
eclipse-score:mainfrom
Valeo-S-CORE-Organization:fix/replace_assert_with_baselibs_macros
Open

Replace assert() with baselibs futurecpp assert macros#279
shegazyy wants to merge 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: 4b09f75d-b0a8-4b12-ac02-dd037eb4f79b
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_crates', the root module requires module version score_crates@0.0.9, but got score_crates@0.0.10 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
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 (33 packages loaded, 10 targets configured)

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

Analyzing: target //:license-check (138 packages loaded, 2725 targets configured)

Analyzing: target //:license-check (146 packages loaded, 5398 targets configured)

Analyzing: target //:license-check (154 packages loaded, 8105 targets configured)

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

Analyzing: target //:license-check (158 packages loaded, 8145 targets configured)

Analyzing: target //:license-check (158 packages loaded, 8145 targets configured)

Analyzing: target //:license-check (161 packages loaded, 10033 targets configured)

Analyzing: target //:license-check (161 packages loaded, 10033 targets configured)

INFO: Analyzed target //:license-check (163 packages loaded, 10283 targets configured).
[1 / 1] no actions running
[13 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
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: 23.143s, Critical Path: 2.55s
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
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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Replace default asserts with baselibs assert macros

1 participant