Skip to content

Conversation

@pljakobs
Copy link
Contributor

fixed a bug in dbgen.py, where a default value was checked against an enum after the value had been converted to an index into the enum as documented in #70

I feel that the 2nd check is redundant as the default has already been verified against the enum and the index was successfully calulated, therefore I believe it can be just removed.

…he value had been converted to an index into the enum
@pljakobs pljakobs changed the title fixed a bug #70 fixed #70 - defaults and enums Sep 10, 2025
@pljakobs
Copy link
Contributor Author

I'm a little unsure about the itemtype naming fix - it seems to build, but I'm not 100% of the wider implications that this may have.
In essence, for all enum fields, I now define {fieldname}ItemType which removes the duplicate definitions.

@pljakobs
Copy link
Contributor Author

okay, my uncertainty was justified, the test build fails with the itemtypes not found, so there's another point where this needs to be adapted.

@pljakobs
Copy link
Contributor Author

looking at the test module:

		auto& colorType = Root::Colors::itemtype;
		auto& quotientType = Root::Quotients::itemtype;
		auto& smallMapType = Root::SmallMap::itemtype;
		auto& numberMapType = Root::NumberMap::itemtype;

those itemtypes are now called colorItemType, quotientsItemType etc - not sure if that's actually a good way to address the issue.

@pljakobs
Copy link
Contributor Author

I am a bit unsure now, with my changes, my firware builds without issues, only this explicit access to itemType in the test fails - not sure what is the relevance.

@mikee47
Copy link
Owner

mikee47 commented Sep 12, 2025

Thanks for this fix. Can you restrict this to just the 'defaults and enums' and we'll look at the itemtype naming separately.

@pljakobs
Copy link
Contributor Author

new push with just 0cfd545

@mikee47
Copy link
Owner

mikee47 commented Sep 13, 2025

Thanks. Amended test schema to ensure this gets covered.

@mikee47 mikee47 changed the title fixed #70 - defaults and enums Fix bug where unable to change default on enum properties Sep 13, 2025
@mikee47 mikee47 changed the title Fix bug where unable to change default on enum properties Unable to change default on enum properties Sep 13, 2025
@mikee47 mikee47 changed the title Unable to change default on enum properties Fix bug where unable to change default on enum properties Sep 13, 2025
@mikee47 mikee47 merged commit 5fddcf6 into mikee47:develop Sep 13, 2025
26 checks passed
@mikee47
Copy link
Owner

mikee47 commented Sep 13, 2025

Thanks for fixing this bug! Note for next time: Remember to create a new branch e.g. fix/enum-bug rather than working on develop directly.

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