Complete test for cluster info in mock tests
diff --git a/test/mock/xiaomi-redmi-note-4.cc b/test/mock/xiaomi-redmi-note-4.cc
index 609ab21..dc4f1de 100644
--- a/test/mock/xiaomi-redmi-note-4.cc
+++ b/test/mock/xiaomi-redmi-note-4.cc
@@ -186,6 +186,88 @@
}
}
+TEST(CLUSTERS, count) {
+ ASSERT_EQ(2, cpuinfo_get_clusters_count());
+}
+
+TEST(CLUSTERS, non_null) {
+ ASSERT_TRUE(cpuinfo_get_clusters());
+}
+
+TEST(CLUSTERS, processor_start) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ switch (i) {
+ case 0:
+ ASSERT_EQ(0, cpuinfo_get_cluster(i)->processor_start);
+ break;
+ case 1:
+ ASSERT_EQ(4, cpuinfo_get_cluster(i)->processor_start);
+ break;
+ }
+ }
+}
+
+TEST(CLUSTERS, processor_count) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(4, cpuinfo_get_cluster(i)->processor_count);
+ }
+}
+
+TEST(CLUSTERS, core_start) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ switch (i) {
+ case 0:
+ ASSERT_EQ(0, cpuinfo_get_cluster(i)->core_start);
+ break;
+ case 1:
+ ASSERT_EQ(4, cpuinfo_get_cluster(i)->core_start);
+ break;
+ }
+ }
+}
+
+TEST(CLUSTERS, core_count) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(4, cpuinfo_get_cluster(i)->core_count);
+ }
+}
+
+TEST(CLUSTERS, cluster_id) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(i, cpuinfo_get_cluster(i)->cluster_id);
+ }
+}
+
+TEST(CLUSTERS, package) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(cpuinfo_get_package(0), cpuinfo_get_cluster(i)->package);
+ }
+}
+
+TEST(CLUSTERS, vendor) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(cpuinfo_vendor_arm, cpuinfo_get_cluster(i)->vendor);
+ }
+}
+
+TEST(CLUSTERS, uarch) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(cpuinfo_uarch_cortex_a53, cpuinfo_get_cluster(i)->uarch);
+ }
+}
+
+TEST(CLUSTERS, midr) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(UINT32_C(0x410FD034), cpuinfo_get_cluster(i)->midr);
+ }
+}
+
+TEST(CLUSTERS, DISABLED_frequency) {
+ for (uint32_t i = 0; i < cpuinfo_get_clusters_count(); i++) {
+ ASSERT_EQ(UINT64_C(2016000000), cpuinfo_get_core(i)->frequency);
+ }
+}
+
TEST(PACKAGES, count) {
ASSERT_EQ(1, cpuinfo_get_packages_count());
}