Fix separators for unit tests

This commit is contained in:
uhliksk 2019-03-13 03:21:12 +01:00
commit 3fb535681b
4 changed files with 19 additions and 1 deletions

View file

@ -108,6 +108,18 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
m_nTempCom = (INT)wParam;
}
// Hardcoded settings for unit tests
if (wParam == IDC_TESTS)
{
m_decimalSeparator = L'.';
SetDecimalSeparator(m_decimalSeparator);
m_groupSeparator = L',';
m_decGrouping = DigitGroupingStringToGroupingVector(L"3;0");
m_input.SetDecimalSymbol(m_decimalSeparator);
m_HistoryCollector.SetDecimalSymbol(m_decimalSeparator);
s_engineStrings[IDS_DECIMAL] = m_decimalSeparator;
}
if (m_bError)
{
if (wParam == IDC_CLEAR)

View file

@ -222,6 +222,8 @@ namespace CalculationManager
CommandBINPOS61 = 761,
CommandBINPOS62 = 762,
CommandBINPOS63 = 763,
CommandBINEDITEND = 763
CommandBINEDITEND = 763,
CommandTESTS = 999
};
}

View file

@ -212,3 +212,4 @@
#define IDS_ENGINESTR_FIRST 0
#define IDS_ENGINESTR_MAX 200
#define IDC_TESTS 999

View file

@ -144,6 +144,8 @@ namespace CalculatorManagerTest
m_calculatorManager->SendCommand(Command::ModeScientific);
}
m_calculatorManager->SendCommand(Command::CommandTESTS);
Command* currentCommand = testCommands;
while (*currentCommand != Command::CommandNULL)
{
@ -309,6 +311,7 @@ namespace CalculatorManagerTest
void CalculatorManagerTest::Cleanup()
{
m_calculatorManager->Reset();
m_calculatorManager->SendCommand(Command::CommandTESTS);
m_calculatorDisplayTester->Reset();
}