From 506f36d3345b7018a275e2aae2e21d938484f0ab Mon Sep 17 00:00:00 2001 From: Guillaume Fieni Date: Wed, 4 Oct 2023 08:41:39 +0200 Subject: [PATCH] test(model): Update CPU topology tests to use integer instead of float for frequencies --- tests/unit/model/test_cpu_topology.py | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/unit/model/test_cpu_topology.py b/tests/unit/model/test_cpu_topology.py index ff348ee..56e40b9 100644 --- a/tests/unit/model/test_cpu_topology.py +++ b/tests/unit/model/test_cpu_topology.py @@ -1,4 +1,4 @@ -# Copyright (c) 2023, INRIA +# Copyright (c) 2023, Inria # Copyright (c) 2023, University of Lille # All rights reserved. # @@ -35,11 +35,11 @@ def test_cpu_topology_amd_epyc_7351(): Test the CPUTopology class with an AMD EPYC 7351 CPU configuration. https://www.amd.com/en/support/cpu/amd-epyc/amd-epyc-7001-series/amd-epyc-7351 """ - cpu_topology = CPUTopology(155, 100.0, 12, 24, 29) - assert cpu_topology.get_min_frequency() == 1200.0 - assert cpu_topology.get_base_frequency() == 2400.0 - assert cpu_topology.get_max_frequency() == 2900.0 - assert cpu_topology.get_supported_frequencies() == [ratio * 100.0 for ratio in range(12, 29 + 1)] + cpu_topology = CPUTopology(155, 100, 12, 24, 29) + assert cpu_topology.get_min_frequency() == 1200 + assert cpu_topology.get_base_frequency() == 2400 + assert cpu_topology.get_max_frequency() == 2900 + assert cpu_topology.get_supported_frequencies() == [ratio * 100 for ratio in range(12, 29 + 1)] def test_cpu_topology_intel_xeon_gold_5220(): @@ -47,19 +47,19 @@ def test_cpu_topology_intel_xeon_gold_5220(): Test the CPUTopology class with an Intel Xeon Gold 5220 CPU configuration. https://www.intel.com/content/www/us/en/products/sku/193388/intel-xeon-gold-5220-processor-24-75m-cache-2-20-ghz/ """ - cpu_topology = CPUTopology(125, 100.0, 10, 22, 39) - assert cpu_topology.get_min_frequency() == 1000.0 - assert cpu_topology.get_base_frequency() == 2200.0 - assert cpu_topology.get_max_frequency() == 3900.0 - assert cpu_topology.get_supported_frequencies() == [ratio * 100.0 for ratio in range(10, 39 + 1)] + cpu_topology = CPUTopology(125, 100, 10, 22, 39) + assert cpu_topology.get_min_frequency() == 1000 + assert cpu_topology.get_base_frequency() == 2200 + assert cpu_topology.get_max_frequency() == 3900 + assert cpu_topology.get_supported_frequencies() == [ratio * 100 for ratio in range(10, 39 + 1)] def test_cpu_topology_with_133mhz_base_clock(): """ Test the CPUTopology class with a base clock of 133MHz. """ - cpu_topology = CPUTopology(0, 133.0, 10, 20, 30) - assert cpu_topology.get_min_frequency() == 1330.0 - assert cpu_topology.get_base_frequency() == 2660.0 - assert cpu_topology.get_max_frequency() == 3990.0 - assert cpu_topology.get_supported_frequencies() == [ratio * 133.0 for ratio in range(10, 30 + 1)] + cpu_topology = CPUTopology(0, 133, 10, 20, 30) + assert cpu_topology.get_min_frequency() == 1330 + assert cpu_topology.get_base_frequency() == 2660 + assert cpu_topology.get_max_frequency() == 3990 + assert cpu_topology.get_supported_frequencies() == [ratio * 133 for ratio in range(10, 30 + 1)]