public void Defect_1467584_Crash_In_Debug_Mode_7() { string src = @" class LabelledEdge extends Edge { y; constructor ByVertexLabels(a : int) : base.add(a) { y = a; } def AddVertices(x : int) { return = Edge.add(x); } } class Edge { a1 : int; constructor add(xx) { a1 = xx; } } edges = LabelledEdge.ByVertexLabels({ 1000, 2000, 3000, 4000, 5000 }); x = edges.AddVertices(0..2); "; DebugTestFx.CompareDebugAndRunResults(src); }
public void Defect_1467584_Crash_In_Debug_Mode_6() { string src = @" class LabelledEdge extends _Edge { constructor ByVertexLabels() { } static def AddVertices(x:int) { return = LabelledEdge.ByVertexLabels(x); } } class _Edge { } edges = { LabelledEdge.ByVertexLabels(), LabelledEdge.ByVertexLabels()}; x = edges.AddVertices(0..1); "; DebugTestFx.CompareDebugAndRunResults(src); }
public void Defect_1467584_Crash_In_Debug_Mode() { string src = @" class LabelledEdge extends _Edge { constructor ByVertexLabels(a : int) { } def AddVertices() { return = LabelledEdge.ByVertexLabels(5); } } class _Edge { } edges = LabelledEdge.ByVertexLabels({ 1000, 2000, 3000, 4000, 5000 }); x = edges.AddVertices(); "; DebugTestFx.CompareDebugAndRunResults(src); }
public void T005_Defect_IDE_963_Crash_On_Debugging() { string src = @" import(""FFITarget.dll""); a : DummyPoint = null; b : DummyLine = null; [Imperative] { a = DummyPoint.ByCoordinates(10, 0, 0); b = DummyLine.ByStartPointEndPoint(a, DummyPoint.ByCoordinates(10, 5, 0)); a = DummyPoint.ByCoordinates(15, 0, 0); } c = b; "; DebugTestFx.CompareDebugAndRunResults(src); }
public void T005_Defect_IDE_963_Crash_On_Debugging() { string src = @" import(""ProtoGeometry.dll""); a : Point = null; b : Line = null; [Imperative] { a = Point.ByCoordinates(10, 0, 0); b = Line.ByStartPointEndPoint(a, Point.ByCoordinates(10, 5, 0)); a = Point.ByCoordinates(15, 0, 0); } c = b; " ; DebugTestFx.CompareDebugAndRunResults(src); }
public void T004_Defect_IDE_963_Crash_On_Debugging() { string defectID = "MAGN-4005 GC issue with globally declared objects used in update loop inside Associative language block"; string src = @" import(""FFITarget.dll""); a : DummyPoint = null; b : DummyLine = null; [Associative] { a = DummyPoint.ByCoordinates(10, 0, 0); b = DummyLine.ByStartPointEndPoint(a, DummyPoint.ByCoordinates(10, 5, 0)); a = DummyPoint.ByCoordinates(15, 0, 0); } c = b; "; DebugTestFx.CompareDebugAndRunResults(src, defectID); }
public void Defect_IDE_884_UsingBangInsideImperative_3() { string src = @" class test { def foo() { a; [Imperative] { included = true; a = !included; } return = a; } } p = test.test(); b = p.foo(); "; DebugTestFx.CompareDebugAndRunResults(src); }
public void Defect_IDE_884_UsingBangInsideImperative_1() { string src = @" class test { static def foo() { included = true; return = [Imperative] { a = !included; return = a; } return = true; } } test1 = test.foo(); "; DebugTestFx.CompareDebugAndRunResults(src); }
/// <summary> /// Runs the code in Normal Execution, Debug StepOver, Debug StepIn /// Verifies that all 3 runs produce the same output /// </summary> /// <param name="code"></param> private void RunDebugEqualityTest(string code) { DebugTestFx.CompareDebugAndRunResults(code); }
public void Defect_1467584_Crash_In_Debug_Mode_4() { string src = @" import(""DSCoreNodes.dll""); import(""ProtoGeometry.dll""); class Mesh { Edges : _Edge[]; Vertices : _Vertex[]; } class EdgeMesh extends Mesh { public constructor ByVerticesEdgeIndices(pointGeometry : Point[], edgeIndices : int[][]) { initialVertices = _Vertex.ByPointGeometry(pointGeometry); Edges = _Edge.ByVertices(initialVertices[edgeIndices[0]], initialVertices[edgeIndices[1]]); Vertices = initialVertices.AddEdges(Edges); } public constructor ByLabelledVerticesEdges(initialVertices : LabelledVertex[], initialEdges : LabelledEdge[]) { Edges = initialEdges.AddVertices(initialVertices); Vertices = initialVertices.AddEdges(Edges); } } class FaceMesh extends Mesh { Faces : _Face[]; public constructor ByVerticesFaceIndices(pointGeometry : Point[], faceIndices : int[][]) { } } class _Vertex { PointGeometry : Point; Edges : _Edge[]; NextVertices : _Vertex[]; constructor ByCoordinates(x : double, y : double, z : double) { PointGeometry = Point.ByCoordinates(x, y, z).SetColor(Color.Red); } constructor ByPointGeometry(pointGeometry : Point) { PointGeometry = pointGeometry; } constructor ByPointGeometryEdges(pointGeometry : Point, edges : _Edge[], nextVertices : _Vertex[]) { PointGeometry = pointGeometry; Edges = edges; NextVertices = nextVertices; } def AddEdges : _Vertex ( allEdges : _Edge[]) { i = 0; temp = this; Print(""temp = "" + temp); localEdges = { }; localNextVertices = { }; [Imperative] { for(m in allEdges) { if (m.StartVertex == temp) { localEdges[i] = m; localNextVertices[i] = m.EndVertex; i = i + 1; } else if (m.EndVertex == temp) { localEdges[i] = m; localNextVertices[i] = m.StartVertex; i = i + 1; } } } Print(""i = "" + i); Print(""localEdgesCount = "" + Count(localEdges)); return = _Vertex.ByPointGeometryEdges(this.PointGeometry, localEdges, localNextVertices); } } class LabelledVertex extends _Vertex { Label : int; constructor ByLabelledCoordinates(label : int, x : double, y : double, z : double) { PointGeometry = Point.ByCoordinates(x, y, z).SetColor(Color.Red); Label = label; } } class _Edge { StartVertex : _Vertex; EndVertex : _Vertex; CurveGeometry : Line; constructor ByVertices(startVertex : _Vertex, endVertex : _Vertex) { StartVertex = startVertex; EndVertex = endVertex; CurveGeometry = Line.ByStartPointEndPoint(StartVertex.PointGeometry, EndVertex.PointGeometry); } } class LabelledEdge extends _Edge { Label : int; StartVertexLabel : int; EndVertexLabel : int; constructor ByVertexLabels(label : int, startVertexLabel : int, endVertexLabel : int) { Label = label; StartVertexLabel = startVertexLabel; EndVertexLabel = endVertexLabel; } constructor ByVertexLabels(label : int, startVertexLabel : int, endVertexLabel : int, labelledVertices : LabelledVertex[]) { Label = label; StartVertex = labelledVertices[IndexOf(labelledVertices.Label, startVertexLabel)]; EndVertex = labelledVertices[IndexOf(labelledVertices.Label, endVertexLabel)]; CurveGeometry = Line.ByStartPointEndPoint(StartVertex.PointGeometry, EndVertex.PointGeometry); } def AddVertices(labelledVertices : LabelledVertex[]) { return = LabelledEdge.ByVertexLabels(this.Label, this.StartVertexLabel, this.EndVertexLabel, labelledVertices); } } class _Face { Edges : _Edge[]; Vertices : _Vertex[]; } vertices = LabelledVertex.ByLabelledCoordinates({ 100, 200, 300, 400 }, { 1, 10, 10, 1 }, { 1, 1, 10, 10 }, 0); edges = LabelledEdge.ByVertexLabels({ 1000, 2000, 3000, 4000, 5000 }, { 100, 200, 300, 400, 100 }, { 200, 300, 400, 100, 300 }); mesh = EdgeMesh.ByLabelledVerticesEdges(vertices, edges); check; [Imperative] { for(i in 5..8) { [Associative] { check = Cone.ByStartPointEndPointRadius(mesh.Vertices[i].PointGeometry, mesh.Vertices[i].NextVertices.PointGeometry, 0.1, 0.2); } Geometry.UpdateDisplay(); Utils.Sleep(2000); } } "; DebugTestFx.CompareDebugAndRunResults(src); }