mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Fixing regression in progvar_prog_scope_init
Change-Id: I20424ce9e0c9a295bb8b9d5608252c3d4802e9da
This commit is contained in:
committed by
sys_ocldev
parent
f7e04a897b
commit
ab74b606e9
@@ -43,7 +43,6 @@ class ProgramDataTestBase : public testing::Test,
|
||||
|
||||
void buildAndDecodeProgramPatchList();
|
||||
|
||||
protected:
|
||||
void SetUp() override {
|
||||
PlatformFixture::SetUp();
|
||||
cl_device_id device = pPlatform->getDevice(0);
|
||||
@@ -120,6 +119,8 @@ class ProgramDataTestBase : public testing::Test,
|
||||
SProgramBinaryHeader programBinaryHeader;
|
||||
void *pProgramPatchList;
|
||||
uint32_t programPatchListSize;
|
||||
cl_int patchlistDecodeErrorCode = 0;
|
||||
bool allowDecodeFailure = false;
|
||||
};
|
||||
|
||||
template <typename ProgramType>
|
||||
@@ -153,7 +154,10 @@ void ProgramDataTestBase<ProgramType>::buildAndDecodeProgramPatchList() {
|
||||
pProgram->storeGenBinary(pProgramData, headerSize + programBinaryHeader.PatchListSize);
|
||||
|
||||
error = pProgram->processGenBinary();
|
||||
EXPECT_EQ(CL_SUCCESS, error);
|
||||
patchlistDecodeErrorCode = error;
|
||||
if (allowDecodeFailure == false) {
|
||||
EXPECT_EQ(CL_SUCCESS, error);
|
||||
}
|
||||
delete[] pProgramData;
|
||||
}
|
||||
|
||||
@@ -363,8 +367,11 @@ TEST_F(ProgramDataTest, GlobalPointerProgramBinaryInfo) {
|
||||
pProgramPatchList = (void *)pGlobalPointer;
|
||||
programPatchListSize = globalPointer.Size;
|
||||
|
||||
this->allowDecodeFailure = true;
|
||||
buildAndDecodeProgramPatchList();
|
||||
EXPECT_EQ(nullptr, pProgram->getGlobalSurface());
|
||||
EXPECT_EQ(CL_INVALID_BINARY, this->patchlistDecodeErrorCode);
|
||||
this->allowDecodeFailure = false;
|
||||
|
||||
delete[] pGlobalPointer;
|
||||
|
||||
@@ -552,8 +559,11 @@ TEST_F(ProgramDataTest, ConstantPointerProgramBinaryInfo) {
|
||||
pProgramPatchList = (void *)pConstantPointer;
|
||||
programPatchListSize = constantPointer.Size;
|
||||
|
||||
this->allowDecodeFailure = true;
|
||||
buildAndDecodeProgramPatchList();
|
||||
EXPECT_EQ(nullptr, pProgram->getConstantSurface());
|
||||
EXPECT_EQ(CL_INVALID_BINARY, this->patchlistDecodeErrorCode);
|
||||
this->allowDecodeFailure = false;
|
||||
|
||||
delete[] pConstantPointer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user