Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: experimental/visual_studio_plugin/src/NaClVsx.Package/NaClVsx.Package_UnitTestProject/DebugInfoEntryTest.cs

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: experimental/visual_studio_plugin/src/NaClVsx.Package/NaClVsx.Package_UnitTestProject/DebugInfoEntryTest.cs
diff --git a/experimental/visual_studio_plugin/src/NaClVsx.Package/NaClVsx.Package_UnitTestProject/DebugInfoEntryTest.cs b/experimental/visual_studio_plugin/src/NaClVsx.Package/NaClVsx.Package_UnitTestProject/DebugInfoEntryTest.cs
deleted file mode 100644
index 9286e192277c118be6704f661a8c60b3992c96c4..0000000000000000000000000000000000000000
--- a/experimental/visual_studio_plugin/src/NaClVsx.Package/NaClVsx.Package_UnitTestProject/DebugInfoEntryTest.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#region
-
-using Google.NaClVsx.DebugSupport.DWARF;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-#endregion
-
-namespace NaClVsx.Package_UnitTestProject {
- /// <summary>
- /// This is a test class for DebugInfoEntryTest and is intended
- /// to contain all DebugInfoEntryTest Unit Tests
- /// </summary>
- [TestClass]
- public class DebugInfoEntryTest {
- /// <summary>
- /// Adds a few RangeList entries to a DIE.
- /// </summary>
- [TestMethod]
- public void AddRangeListEntryByAddressTest() {
- var target = new DebugInfoEntry();
- var rangeListEntry1 = new RangeListEntry();
- var rangeListEntry2 = new RangeListEntry();
- var redundantRangeListEntry = new RangeListEntry();
- target.AddRangeListEntryByAddress(1234, rangeListEntry1);
- target.AddRangeListEntryByAddress(4567, rangeListEntry2);
- target.AddRangeListEntryByAddress(1234, redundantRangeListEntry);
- Assert.AreEqual(2, target.RangeListsByAddress.Count);
- }
-
- /// <summary>
- /// A test for GetLowPC
- /// </summary>
- [TestMethod]
- public void GetLowPCTest() {
- var target = new DebugInfoEntry();
- ulong expected = 0;
- Assert.AreEqual(expected, target.GetLowPC());
- expected = 123456;
- target.Attributes.Add(DwarfAttribute.DW_AT_low_pc, expected);
- Assert.AreEqual(expected, target.GetLowPC());
- }
-
- /// <summary>
- /// A test for GetFrameBase
- /// </summary>
- [TestMethod]
- public void GetFrameBaseTest() {
- var target = new DebugInfoEntry();
- ulong expected = 0;
- Assert.AreEqual(expected, target.GetFrameBase());
- expected = 123456;
- target.Attributes.Add(DwarfAttribute.DW_AT_frame_base, expected);
- Assert.AreEqual(expected, target.GetFrameBase());
- }
-
- /// <summary>
- /// A test for DebugInfoEntry Constructor
- /// </summary>
- [TestMethod]
- public void DebugInfoEntryConstructorTest() {
- var target = new DebugInfoEntry();
- Assert.IsNotNull(target);
- }
-
- /// <summary>
- /// A test for GetNearestAncestorWithTag
- /// </summary>
- [TestMethod]
- public void GetNearestAncestorWithTagTest() {
- var target = new DebugInfoEntry();
- DebugInfoEntry expected = null;
- Assert.AreEqual(
- expected,
- target.GetNearestAncestorWithTag(DwarfTag.DW_TAG_subprogram));
- target.Tag = DwarfTag.DW_TAG_subprogram;
- expected = target;
- Assert.AreEqual(
- expected,
- target.GetNearestAncestorWithTag(DwarfTag.DW_TAG_subprogram));
- target.Tag = DwarfTag.DW_TAG_namelist_item;
- expected = new DebugInfoEntry();
- expected.Tag = DwarfTag.DW_TAG_subprogram;
- target.OuterScope = expected;
- Assert.AreEqual(
- expected,
- target.GetNearestAncestorWithTag(DwarfTag.DW_TAG_subprogram));
- }
-
- /// <summary>
- /// A test for HasAttribute. Checks both "true" and "false" cases.
- /// </summary>
- [TestMethod]
- public void HasAttributeTest() {
- var target = new DebugInfoEntry();
- const DwarfAttribute kAttribute = DwarfAttribute.DW_AT_ranges;
- Assert.IsFalse(target.HasAttribute(kAttribute));
- target.Attributes.Add(DwarfAttribute.DW_AT_ranges, 0);
- Assert.IsTrue(target.HasAttribute(kAttribute));
- }
-
- /// <summary>
- /// A test for HasAsAncestor. Checks the case where the ancestor does not exist, the case
- /// where the ancestor is a direct parent, and the case where the ancestor is more distant.
- /// </summary>
- [TestMethod]
- public void HasAsAncestorTest() {
- var target = new DebugInfoEntry();
- const ulong kAncestorKey = 123456;
- Assert.IsFalse(target.HasAsAncestor(kAncestorKey));
- var ancestor = new DebugInfoEntry();
- ancestor.Key = kAncestorKey;
- target.ParentKey = kAncestorKey;
- target.OuterScope = ancestor;
- Assert.IsTrue(target.HasAsAncestor(kAncestorKey));
- var parent = new DebugInfoEntry();
- parent.OuterScope = ancestor;
- parent.ParentKey = kAncestorKey;
- target.OuterScope = parent;
- Assert.IsTrue(target.HasAsAncestor(kAncestorKey));
- }
-
- /// <summary>
- /// A test for GetRangesOffset
- /// </summary>
- [TestMethod]
- public void GetRangesOffsetTest() {
- var target = new DebugInfoEntry();
- Assert.AreEqual(ulong.MaxValue, target.GetRangesOffset());
- const ulong kRangesOffset = 123456;
- target.Attributes.Add(DwarfAttribute.DW_AT_ranges, kRangesOffset);
- Assert.AreEqual(kRangesOffset, target.GetRangesOffset());
- }
- }
-}

Powered by Google App Engine
This is Rietveld 408576698