private static GenericIntelCpu GetCpu(string fileName) { string fullPath = Path.Combine(TestResources, fileName); CpuIdXmlFactory factory = new CpuIdXmlFactory(); ICpuId cpu = factory.Create(fullPath); GenericIntelCpu x86cpu = cpu as GenericIntelCpu; Assert.That(cpu, Is.Not.Null); Assert.That(cpu.CpuVendor, Is.EqualTo(CpuVendor.Unknown)); Assert.That(cpu.VendorId, Is.EqualTo(" ")); Assert.That(x86cpu.Topology.CoreTopology.IsReadOnly, Is.True); Assert.That(x86cpu.Topology.CoreTopology.Count, Is.EqualTo(0)); Assert.That(x86cpu.Topology.CacheTopology.IsReadOnly, Is.True); Assert.That(x86cpu.Topology.CacheTopology.Count, Is.EqualTo(0)); return(x86cpu); }
protected ICpuIdX86 Create(BasicCpu cpu) { ICpuIdX86 x86cpu; switch (cpu.VendorId) { case "GenuineIntel": try { x86cpu = new GenuineIntelCpu(cpu); } catch { if (!cpu.CpuRegisters.IsOnline) { throw; } x86cpu = new GenericIntelCpu(cpu); } break; case "AuthenticAMD": try { x86cpu = new AuthenticAmdCpu(cpu); } catch { if (!cpu.CpuRegisters.IsOnline) { throw; } x86cpu = new GenericIntelCpu(cpu); } break; default: x86cpu = new GenericIntelCpu(cpu); break; } x86cpu.Topology.CoreTopology.IsReadOnly = true; x86cpu.Topology.CacheTopology.IsReadOnly = true; return(x86cpu); }
public void LoadGenericProcessor() { GenericIntelCpu cpu = GetCpu("i7-9700_novendor.xml"); Assert.That(cpu.Description, Is.Empty); }