Exemplo n.º 1
0
        public async Task BuildSetsWithRealAndSyntheticRegisterSetsAsync()
        {
            mockFrame.GetRegisters().Returns(
                new List <RemoteValue> {
                generalPurposeRegisters, floatingPointRegisters
            });

            var sets = registerSetsBuilder.BuildSets().ToList();

            Assert.AreEqual(4, sets.Count);
            IVariableInformation cpu = sets[0];

            Assert.AreEqual("CPU", cpu.DisplayName);
            IEnumerable <IVariableInformation> gprChildren = await cpu.GetAllChildrenAsync();

            Assert.AreEqual(0, gprChildren.Count());
            Assert.AreEqual(CustomVisualizer.None, cpu.CustomVisualizer);

            IVariableInformation fpr = sets[1];

            Assert.AreEqual("Floating Point Registers", fpr.DisplayName);
            IEnumerable <IVariableInformation> fprChildren = await fpr.GetAllChildrenAsync();

            CollectionAssert.AreEqual(
                new[] { "xmm0", "xmm8", "other" }, fprChildren.Select(r => r.DisplayName));
            Assert.AreEqual(CustomVisualizer.None, fpr.CustomVisualizer);

            IVariableInformation sse = sets[2];

            Assert.AreEqual("SSE", sse.DisplayName);
            IEnumerable <IVariableInformation> sseChildren = await sse.GetAllChildrenAsync();

            CollectionAssert.AreEqual(
                new[] { "xmm0", "xmm8", "other" }, sseChildren.Select(r => r.DisplayName));
            Assert.AreEqual(CustomVisualizer.SSE, sse.CustomVisualizer);

            IVariableInformation sse2 = sets[3];

            Assert.AreEqual("SSE2", sse2.DisplayName);
            IEnumerable <IVariableInformation> sse2Children = await sse2.GetAllChildrenAsync();

            CollectionAssert.AreEqual(
                new[] { "xmm0", "xmm8", "other" }, sse2Children.Select(r => r.DisplayName));
            Assert.AreEqual(CustomVisualizer.SSE2, sse2.CustomVisualizer);
        }