mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Fix separators for unit tests
This commit is contained in:
parent
a80d082242
commit
3fb535681b
4 changed files with 19 additions and 1 deletions
|
@ -108,6 +108,18 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
|
||||||
m_nTempCom = (INT)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 (m_bError)
|
||||||
{
|
{
|
||||||
if (wParam == IDC_CLEAR)
|
if (wParam == IDC_CLEAR)
|
||||||
|
|
|
@ -222,6 +222,8 @@ namespace CalculationManager
|
||||||
CommandBINPOS61 = 761,
|
CommandBINPOS61 = 761,
|
||||||
CommandBINPOS62 = 762,
|
CommandBINPOS62 = 762,
|
||||||
CommandBINPOS63 = 763,
|
CommandBINPOS63 = 763,
|
||||||
CommandBINEDITEND = 763
|
CommandBINEDITEND = 763,
|
||||||
|
|
||||||
|
CommandTESTS = 999
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,3 +212,4 @@
|
||||||
#define IDS_ENGINESTR_FIRST 0
|
#define IDS_ENGINESTR_FIRST 0
|
||||||
#define IDS_ENGINESTR_MAX 200
|
#define IDS_ENGINESTR_MAX 200
|
||||||
|
|
||||||
|
#define IDC_TESTS 999
|
||||||
|
|
|
@ -144,6 +144,8 @@ namespace CalculatorManagerTest
|
||||||
m_calculatorManager->SendCommand(Command::ModeScientific);
|
m_calculatorManager->SendCommand(Command::ModeScientific);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_calculatorManager->SendCommand(Command::CommandTESTS);
|
||||||
|
|
||||||
Command* currentCommand = testCommands;
|
Command* currentCommand = testCommands;
|
||||||
while (*currentCommand != Command::CommandNULL)
|
while (*currentCommand != Command::CommandNULL)
|
||||||
{
|
{
|
||||||
|
@ -309,6 +311,7 @@ namespace CalculatorManagerTest
|
||||||
void CalculatorManagerTest::Cleanup()
|
void CalculatorManagerTest::Cleanup()
|
||||||
{
|
{
|
||||||
m_calculatorManager->Reset();
|
m_calculatorManager->Reset();
|
||||||
|
m_calculatorManager->SendCommand(Command::CommandTESTS);
|
||||||
m_calculatorDisplayTester->Reset();
|
m_calculatorDisplayTester->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue