Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.8.x'
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>

# Conflicts:
#	helm/hpcc/Chart.yaml
#	helm/hpcc/templates/_helpers.tpl
#	version.cmake
  • Loading branch information
ghalliday committed Nov 19, 2024
2 parents 5d7636b + 17590a5 commit 92149e3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dali/ft/filecopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ void FileSprayer::commonUpSlaves()
bool commonByIp = !isContainerized();

offset_t totalSourceFileSize = 0;
offset_t threshold = 0x8000 * numSlaves;
offset_t threshold = (offset_t)0x8000 * numSlaves;
ForEachItemIn(i, sources)
{
const FilePartInfo & cur = sources.item(i);
Expand Down
38 changes: 19 additions & 19 deletions testing/unittests/espapicmdtests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,6 @@ class EspApiCmdTest : public CppUnit::TestFixture
sasha(createIFile("/tmp/hpcctest/sasha.xml"))
{
try{
InitModuleObjects();
queryStderrLogMsgHandler()->setMessageFields(0);
queryLogMsgManager()->removeMonitor(queryStderrLogMsgHandler());
dir->createDirectory();

Owned<IFileIO> ioCommon = common->open(IFOcreate);
Expand Down Expand Up @@ -317,7 +314,7 @@ class EspApiCmdTest : public CppUnit::TestFixture
"/tmp/hpcctest/common.xml\n"
"/tmp/hpcctest/store.xml\n";

for(Owned<IFile>& myfile: env.files)
for(Owned<IFile>& myfile: queryEnvironment().files)
{
fileStr.append(myfile->queryFilename());
fileStr.append("\n");
Expand All @@ -333,7 +330,7 @@ class EspApiCmdTest : public CppUnit::TestFixture
string refStr =
"WSSasha\n"
"wsstore\n";
vector<const char*> services = env.esdlDefObj.getAllServices();
vector<const char*> services = queryEnvironment().esdlDefObj.getAllServices();
for(const char* service : services)
{
serviceStr.append(service);
Expand All @@ -351,7 +348,7 @@ class EspApiCmdTest : public CppUnit::TestFixture
ostringstream oss;
string res;

env.esdlDefObj.describeAllServices(oss);
queryEnvironment().esdlDefObj.describeAllServices(oss);
res = oss.str();

sortAndWriteBack(res);
Expand All @@ -368,7 +365,7 @@ class EspApiCmdTest : public CppUnit::TestFixture
"Ping\n"
"RestoreWU\n";

vector<const char*> methods = env.esdlDefObj.getAllMethods();
vector<const char*> methods = queryEnvironment().esdlDefObj.getAllMethods();
for(const char* &method:methods)
{
methodStr.append(method);
Expand All @@ -388,7 +385,7 @@ class EspApiCmdTest : public CppUnit::TestFixture
ostringstream oss;
string res;

env.esdlDefObj.describeAllMethods("WSSasha",oss);
queryEnvironment().esdlDefObj.describeAllMethods("WSSasha",oss);
res = oss.str();

sortAndWriteBack(res);
Expand All @@ -399,22 +396,22 @@ class EspApiCmdTest : public CppUnit::TestFixture
}
void testCheckValidService()
{
bool validCheck = env.esdlDefObj.checkValidService("WSSasha");
bool invalidCheck = env.esdlDefObj.checkValidService("InvalidService");
bool validCheck = queryEnvironment().esdlDefObj.checkValidService("WSSasha");
bool invalidCheck = queryEnvironment().esdlDefObj.checkValidService("InvalidService");
CPPUNIT_ASSERT_EQUAL(validCheck, true);
CPPUNIT_ASSERT_EQUAL(invalidCheck, false);
}
void testCheckValidMethod()
{
bool validCheck = env.esdlDefObj.checkValidMethod("GetVersion", "WSSasha");
bool invalidCheck = env.esdlDefObj.checkValidMethod("InvalidMethod", "WSSasha");
bool validCheck = queryEnvironment().esdlDefObj.checkValidMethod("GetVersion", "WSSasha");
bool invalidCheck = queryEnvironment().esdlDefObj.checkValidMethod("InvalidMethod", "WSSasha");
CPPUNIT_ASSERT_EQUAL(validCheck, true);
CPPUNIT_ASSERT_EQUAL(invalidCheck, false);

}
void testDescribe()
{
env.esdlDefObj.loadAllMethods("wsstore");
queryEnvironment().esdlDefObj.loadAllMethods("wsstore");
string refString =
"ListStoresRequest\n"
"string NameFilter\n"
Expand All @@ -438,19 +435,19 @@ class EspApiCmdTest : public CppUnit::TestFixture

ostringstream oss;
string res;
env.esdlDefObj.describe("wsstore","ListStores", oss);
queryEnvironment().esdlDefObj.describe("wsstore","ListStores", oss);
res = oss.str();

oss.str("");
oss.clear();
string invalidServiceRes;
env.esdlDefObj.describe("bad_name","ListStores", oss);
queryEnvironment().esdlDefObj.describe("bad_name","ListStores", oss);
invalidServiceRes = oss.str();

oss.str("");
oss.clear();
string invalidMethodRes;
env.esdlDefObj.describe("wsstore","bad_name", oss);
queryEnvironment().esdlDefObj.describe("wsstore","bad_name", oss);
invalidMethodRes = oss.str();

CPPUNIT_ASSERT_EQUAL(refString, res);
Expand All @@ -459,7 +456,12 @@ class EspApiCmdTest : public CppUnit::TestFixture
}

private:
static Environment env;
Environment & queryEnvironment()
{
//Avoid creating this object until it is first used - otherwise any calls to the logging will crash
static Environment env;
return env;
}

void sortAndWriteBack(string& input)
{
Expand All @@ -485,8 +487,6 @@ class EspApiCmdTest : public CppUnit::TestFixture
}
};

EspApiCmdTest::Environment EspApiCmdTest::env;

CPPUNIT_TEST_SUITE_REGISTRATION( EspApiCmdTest );
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( EspApiCmdTest, "EspApiCmdTest" );

Expand Down

0 comments on commit 92149e3

Please sign in to comment.