Skip to content

Conversation

FallJock
Copy link

@FallJock FallJock commented Dec 7, 2024

The test has been improved in the code.

Fixes #.

Edit UnitConverterTestUnitTypeSwitching in UnitConverterTest.cpp

Description of the changes:

  • Now UnitConverterTestUnitTypeSwitching checks for changes after the function of SwitchActive and fits a new value separately into the to field after the function of SwitchActive.
  • When I tried to edit the SwitchActive function, I removed the swap of fromType and toType.

2024-12-07_16-06-38

And I ran all the tests. And only UnitConverterTestScientificInputs detected a value error when using the SwitchActive function.

2024-12-07_13-03-36

Without changing the SwitchActive function code
Without changing

With changes in the SwitchActive function code (deleting swap(m_fromType, m_toType);)
With changes

How changes were validated:

  • Previously, the test of the SwitchActive function worked before the specified category - Weight, now the SwitchActive function works after the specified category and changes in the field selection are taken into account.

The test has been improved in the code, now it checks for changes after the function of SwitchActive and fits a new value separately into the to field after the function of SwitchActive
When I tried to edit the SwitchActive function, I removed the swap of fromType and toType. And I ran all the tests.
And only UnitConverterTestScientificInputs detected a value error when using the SwitchActive function.
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.

1 participant