0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-20264 jstests/core/hostinfo.js fails on s390x

This commit is contained in:
Waley 2016-01-26 14:55:07 -05:00 committed by Waley
parent e347067334
commit 21d4e1be28
2 changed files with 7 additions and 1 deletions

View File

@ -269,7 +269,7 @@ public:
while (fgets(fstr, 1023, f) != NULL && !feof(f)) {
// until the end of the file
fstr[strlen(fstr) < 1 ? 0 : strlen(fstr) - 1] = '\0';
if (strncmp(fstr, "processor\t:", 11) == 0)
if (strncmp(fstr, "processor ", 10) == 0 || strncmp(fstr, "processor\t:", 11) == 0)
++procCount;
if (strncmp(fstr, "cpu MHz\t\t:", 10) == 0)
freq = fstr + 11;

View File

@ -48,4 +48,10 @@ TEST(ProcessInfo, NonZeroPageSize) {
ASSERT_GREATER_THAN(ProcessInfo::getPageSize(), 0u);
}
}
TEST(ProcessInfo, GetNumCoresReturnsNonZeroNumberOfProcessors) {
ProcessInfo processInfo;
ProcessInfo::initializeSystemInfo();
ASSERT_GREATER_THAN((int)processInfo.getNumCores(), 0);
}
}