Enabling gcc8

Change-Id: Ib43600b323be6e8d4a118fecc656a3924e05959c
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2018-05-17 23:57:53 +02:00
committed by sys_ocldev
parent a9a1384ef5
commit 6fe9840fde
11 changed files with 48 additions and 37 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -91,21 +91,35 @@ TEST(StringHelpers, strcpy) {
ASSERT_EQ(sizeof(dst), sizeof(src));
auto ret = strcpy_s(nullptr, sizeof(dst), src);
auto ret = strcpy_s(nullptr, 0, src);
EXPECT_EQ(ret, -EINVAL);
ret = strcpy_s(dst, sizeof(dst), nullptr);
ret = strcpy_s(nullptr, sizeof(dst), src);
EXPECT_EQ(ret, -EINVAL);
ret = strcpy_s(nullptr, 0, nullptr);
EXPECT_EQ(ret, -EINVAL);
ret = strcpy_s(nullptr, sizeof(dst), nullptr);
EXPECT_EQ(ret, -EINVAL);
ret = strcpy_s(dst, 0, nullptr);
EXPECT_EQ(ret, -EINVAL);
ret = strcpy_s(dst, strlen(src) / 2, src);
EXPECT_EQ(ret, -ERANGE);
memset(dst, 0, sizeof(dst));
ret = strcpy_s(dst, strlen(src), src);
EXPECT_EQ(ret, -ERANGE);
char pattern = 0x5a;
memset(dst, pattern, sizeof(dst));
ret = strcpy_s(dst, sizeof(dst), src);
EXPECT_EQ(ret, 0);
EXPECT_EQ(0, memcmp(dst, src, strlen(src)));
for (size_t i = strlen(src); i < sizeof(dst); i++)
EXPECT_EQ(0, dst[i]);
EXPECT_EQ(0, dst[strlen(src)]);
for (size_t i = strlen(src) + 1; i < sizeof(dst); i++)
EXPECT_EQ(pattern, dst[i]);
}
TEST(StringHelpers, strnlen) {

View File

@ -224,10 +224,10 @@ static uint32_t ImageType[] = {
CL_MEM_OBJECT_IMAGE1D_ARRAY,
CL_MEM_OBJECT_IMAGE2D_ARRAY};
typedef decltype(numReadWriteSurfaceFormats) ReadWriteSurfaceFormatsCountType;
decltype(numReadWriteSurfaceFormats) readWriteSurfaceFormatsStart = 0u;
INSTANTIATE_TEST_CASE_P(
Redescribe,
ImageRedescribeTest,
testing::Combine(
::testing::Range(static_cast<ReadWriteSurfaceFormatsCountType>(0u), numReadWriteSurfaceFormats),
::testing::ValuesIn(ImageType)));
::testing::Range(readWriteSurfaceFormatsStart, numReadWriteSurfaceFormats),
::testing::ValuesIn(ImageType)));

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@ -60,7 +60,7 @@ class VASharingFunctionsMock : public VASharingFunctions {
return (VAStatus)0; // success
};
static VAPrivFunc mockVaGetLibFunc(VADisplay vaDisplay, const char *func) {
static void *mockVaGetLibFunc(VADisplay vaDisplay, const char *func) {
vaGetLibFuncCalled++;
return nullptr;
};

View File

@ -30,7 +30,7 @@ TEST(SkuInfoTransferTest, givenFeatureTableWhenFillingStructureForGmmThenCopyOnl
_SKU_FEATURE_TABLE requestedFtrTable = {};
_SKU_FEATURE_TABLE refFtrTable = {};
FeatureTable featureTable;
memset(&featureTable, 1, sizeof(FeatureTable));
memset(reinterpret_cast<void *>(&featureTable), 1, sizeof(FeatureTable));
SkuInfoTransfer::transferFtrTableForGmm(&requestedFtrTable, &featureTable);
SkuInfoBaseReference::fillReferenceFtrForTransfer(refFtrTable);
@ -43,7 +43,7 @@ TEST(SkuInfoTransferTest, givenWaTableWhenFillingStructureForGmmThenCopyOnlySele
_WA_TABLE refWaTable = {};
WorkaroundTable waTable;
refWaTable = {};
memset(&waTable, 1, sizeof(WorkaroundTable));
memset(reinterpret_cast<void *>(&waTable), 1, sizeof(WorkaroundTable));
SkuInfoTransfer::transferWaTableForGmm(&requestedWaTable, &waTable);
SkuInfoBaseReference::fillReferenceWaForTransfer(refWaTable);