Basic test for cluster info in mock tests
diff --git a/test/mock/oneplus-5t.cc b/test/mock/oneplus-5t.cc
index a39e98b..b28ad42 100644
--- a/test/mock/oneplus-5t.cc
+++ b/test/mock/oneplus-5t.cc
@@ -24,6 +24,25 @@
}
}
+TEST(PROCESSORS, cluster) {
+ for (uint32_t i = 0; i < cpuinfo_get_processors_count(); i++) {
+ switch (i) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ ASSERT_EQ(cpuinfo_get_cluster(0), cpuinfo_get_processor(i)->cluster);
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ ASSERT_EQ(cpuinfo_get_cluster(1), cpuinfo_get_processor(i)->cluster);
+ break;
+ }
+ }
+}
+
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);
@@ -118,6 +137,25 @@
}
}
+TEST(CORES, cluster) {
+ for (uint32_t i = 0; i < cpuinfo_get_cores_count(); i++) {
+ switch (i) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ ASSERT_EQ(cpuinfo_get_cluster(0), cpuinfo_get_core(i)->cluster);
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ ASSERT_EQ(cpuinfo_get_cluster(1), cpuinfo_get_core(i)->cluster);
+ break;
+ }
+ }
+}
+
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);
@@ -231,6 +269,18 @@
}
}
+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(2, cpuinfo_get_package(i)->cluster_count);
+ }
+}
+
TEST(ISA, thumb) {
#if CPUINFO_ARCH_ARM
ASSERT_TRUE(cpuinfo_has_arm_thumb());