Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gsa): prevent exception on gsamemb2d from gwa (SPEC-522) #231

Open
wants to merge 2 commits into
base: jm/dev/2.13.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ConnectorGSA/ConnectorGSATests/SchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,16 @@ public void GsaMemb1dSimple()
//Assert.True(ModelValidation(gwaToTest, GsaRecord.GetKeyword<GsaMemb>(), 3, out var mismatch));
}

[Fact]
public void GsaMemb2dFromGwa_WithEmptyPointNodeIndices_ReturnsTrue()
{
var gsaMemb2d = "MEMB.8\t5730\t\tNO_RGB\t2D_GENERIC\tALL\t3\t0\t21759 4928 4927 21762 21759 P()\t0\t0\t0\tYES\tLINEAR\t0\t0\t0\t0\t0\t0\tACTIVE\t0\tNO\tREBAR_2D.1\t0.03\t0.03\t0";

var memParser = new GsaMembParser();

Assert.True(memParser.FromGwa(gsaMemb2d));
}

[Fact (Skip = "WIP")]
public void GsaMemb2dSimple()
{
Expand Down
2 changes: 1 addition & 1 deletion ConnectorGSA/GSAProxy/GwaParsers/GsaMembParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ protected bool AddName(string v)
}
private bool AddTopology(string v)
{
var bracketPieces = v.Split(new[] { '(', ')' }).Select(s => s.Trim()).ToList();
var bracketPieces = v.Split(new[] { '(', ')' }, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Trim()).ToList();
if (bracketPieces.Count() > 1)
{
var listTypes = bracketPieces.Take(bracketPieces.Count() - 1).Select(bp => bp.Last()).ToList();
Expand Down