diff options
author | Marat Dukhan <maratek@gmail.com> | 2018-03-18 16:15:36 -0700 |
---|---|---|
committer | Marat Dukhan <maratek@gmail.com> | 2018-03-18 16:15:36 -0700 |
commit | 2b307933d11d9119e643a68e021b6c853780c66f (patch) | |
tree | 8bffcf952a8470203fcdb0708bab6afbff7057bb /test/mock/pixel-c.cc | |
parent | 32e42ef120f10f169953bca565ab441071a8e15a (diff) | |
download | cpuinfo-2b307933d11d9119e643a68e021b6c853780c66f.tar.gz |
Basic test for cluster info in mock tests
Diffstat (limited to 'test/mock/pixel-c.cc')
-rw-r--r-- | test/mock/pixel-c.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/mock/pixel-c.cc b/test/mock/pixel-c.cc index 1910ef9..5f2a66d 100644 --- a/test/mock/pixel-c.cc +++ b/test/mock/pixel-c.cc @@ -24,6 +24,12 @@ TEST(PROCESSORS, core) { } } +TEST(PROCESSORS, cluster) { + for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { + ASSERT_EQ(cpuinfo_get_cluster(0), cpuinfo_get_processor(i)->cluster); + } +} + TEST(PROCESSORS, package) { for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) { ASSERT_EQ(cpuinfo_get_package(0), cpuinfo_get_processor(i)->package); @@ -92,6 +98,12 @@ TEST(CORES, core_id) { } } +TEST(CORES, cluster) { + for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { + ASSERT_EQ(cpuinfo_get_cluster(0), cpuinfo_get_core(i)->cluster); + } +} + TEST(CORES, package) { for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) { ASSERT_EQ(cpuinfo_get_package(0), cpuinfo_get_core(i)->package); @@ -166,6 +178,18 @@ TEST(PACKAGES, core_count) { } } +TEST(PACKAGES, cluster_start) { + for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { + ASSERT_EQ(0, cpuinfo_get_package(i)->cluster_start); + } +} + +TEST(PACKAGES, cluster_count) { + for (uint32_t i = 0; i < cpuinfo_get_packages_count(); i++) { + ASSERT_EQ(1, cpuinfo_get_package(i)->cluster_count); + } +} + TEST(ISA, thumb) { #if CPUINFO_ARCH_ARM ASSERT_TRUE(cpuinfo_has_arm_thumb()); |