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