Skip to content

Add optional boolean type#84

Open
okt-yurijp wants to merge 2 commits into
oktetlabs:mainfrom
okt-yurijp:optional_boolean
Open

Add optional boolean type#84
okt-yurijp wants to merge 2 commits into
oktetlabs:mainfrom
okt-yurijp:optional_boolean

Conversation

@okt-yurijp

Copy link
Copy Markdown
Contributor

Add optional boolean type and helpers for it.

Similar to the optional uint type, but for boolean variables.

Signed-off-by: Artemii Morozov <artemii.morozov@arknetworks.am>
Acked-by: Yurij Plotnikov <yurij.plotnikov@arknetworks.am>
These functions and marcos could be used to get optional boolean type
from the XML.

Signed-off-by: Artemii Morozov <artemii.morozov@arknetworks.am>
Acked-by: Yurij Plotnikov <yurij.plotnikov@arknetworks.am>

@ol-arteman ol-arteman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We do already have te_bool3 type with three values and a job opt wrapper for it TAPI_JOB_OPT_ENUM_BOOL3. So I'd like to see any rationale why we need another type with basically the same semantics. Or e.g. why we should abandon te_bool3 in favor of te_optional_bool_t

@okt-yurijp

Copy link
Copy Markdown
Contributor Author

Sorry for great delay in anwer(
We use this type in our new suite together with te_optional_uint_t type. And in package.xml we use value "-" for both of these types.
Now, if we switch to te_bool3 we have 4 options:

  1. Substitute "-" value to "UNKNOWN". But it looks a little bit ugly: in one place we use "-" for optional int and in another place we need to use "UNKNOWN" in the same meaning for te_bool3.
  2. Add parser of "-" value in our suite only. But may be it can be useful for other suites too.
  3. Add additional parser of "-" value to TE for te_bool3 type.
  4. Use this patch with te_optional_bool_t

Which option do you prefer?

@okt-yurijp okt-yurijp requested a review from ol-arteman October 8, 2025 05:59
@ol-arteman

Copy link
Copy Markdown
Collaborator

Sorry for great delay in anwer( We use this type in our new suite together with te_optional_uint_t type. And in package.xml we use value "-" for both of these types. Now, if we switch to te_bool3 we have 4 options:

1. Substitute "-" value to "UNKNOWN". But it looks a little bit ugly: in one place we use "-" for optional int and in another place we need to use "UNKNOWN" in the same meaning for te_bool3.

2. Add parser of "-" value in our suite only. But may be it can be useful for other suites too.

3. Add additional parser of "-" value to TE for te_bool3 type.

4. Use this patch with te_optional_bool_t

Which option do you prefer?

I am definitely for option (3).

@okt-dmitriyb

Copy link
Copy Markdown

Created new PR with (3)
#96

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.

5 participants