2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2020-01-27 17:28:10 +01:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2019-02-27 11:39:32 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/array_count.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-03-25 15:57:38 +01:00
|
|
|
TEST(ArrayCountTests, WhenGettingArrayCountThenCorrectCountIsReturned) {
|
2017-12-21 00:45:38 +01:00
|
|
|
int a[10];
|
|
|
|
|
EXPECT_EQ(10u, arrayCount(a));
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-25 15:57:38 +01:00
|
|
|
TEST(ArrayCountTests, WhenGettingInRangeThenOnlyIndexInRangeReturnsTrue) {
|
2017-12-21 00:45:38 +01:00
|
|
|
int a[10];
|
|
|
|
|
EXPECT_TRUE(isInRange(1, a));
|
|
|
|
|
EXPECT_FALSE(isInRange(10, a));
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|