Skip to content

Commit 0520235

Browse files
committed
rl -timeout overrides XML value based on numeric value of argument
1 parent fed9437 commit 0520235

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

bin/rl/rl.cpp

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3537,6 +3537,19 @@ IsTimeoutStringValid(const char *strTimeout) {
35373537
return TRUE;
35383538
}
35393539

3540+
uint32 GetTimeoutValue(const char *strTimeout)
3541+
{
3542+
if (strTimeout == nullptr)
3543+
{
3544+
return 0;
3545+
}
3546+
3547+
char *end = nullptr;
3548+
_set_errno(0);
3549+
uint32 secTimeout = strtoul(strTimeout, &end, 10);
3550+
return secTimeout;
3551+
}
3552+
35403553
BOOL
35413554
GetTestInfoFromNode
35423555
(
@@ -3592,17 +3605,20 @@ GetTestInfoFromNode
35923605
// Validate the timeout string now to fail early so we don't run any tests when there is an error.
35933606
if (!IsTimeoutStringValid(testInfo->data[i])) {
35943607
CFG_ERROR_EX(fileName, node->LineNumber,
3595-
"Invalid timeout specified. Cannot parse or too large.\n", NULL);
3608+
"Invalid timeout specified. Cannot parse or too large.\n", NULL);
35963609
childNode->Dump();
35973610
return FALSE;
35983611
}
35993612
}
36003613
}
36013614
}
3602-
if (i == TIK_TIMEOUT && TestTimeout != NULL)
3615+
3616+
if (i == TIK_TIMEOUT && TestTimeout != nullptr)
36033617
{
36043618
// Overriding the timeout value with the command line value (if the command line value is larger)
3605-
if (testInfo->data[i] < TestTimeout)
3619+
uint32 xmlTimeoutValue = GetTimeoutValue(testInfo->data[i]);
3620+
uint32 testTimeoutValue = GetTimeoutValue(TestTimeout);
3621+
if (xmlTimeoutValue < testTimeoutValue)
36063622
{
36073623
testInfo->data[i] = TestTimeout;
36083624
}

0 commit comments

Comments
 (0)