Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit a92c91b

Browse files
Merge pull request #391 from xamarin/protocol-list-demangling
TEST ALL THE PROTOCOLS
2 parents 4e82999 + 25845b6 commit a92c91b

File tree

1 file changed

+132
-0
lines changed

1 file changed

+132
-0
lines changed

tests/tom-swifty-test/SwiftReflector/Swift4DemanglerTests.cs

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,5 +1428,137 @@ public void TestGenericMetatype ()
14281428
Assert.IsNotNull (arg1, "not a metaclass type");
14291429
Assert.IsNotNull (arg1.ClassGenericReference, "not a generic reference metatype");
14301430
}
1431+
1432+
[Test]
1433+
public void TestProtocolList0 ()
1434+
{
1435+
var tld = Decomposer.Decompose ("_$s6Lottie10StrokeNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvg", false);
1436+
Assert.IsNotNull (tld, "failed decomposition");
1437+
var tlf = tld as TLFunction;
1438+
Assert.IsNotNull (tlf, "not a function");
1439+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1440+
Assert.IsNotNull (ret, "not a protocol list");
1441+
Assert.AreEqual (2, ret.Protocols.Count);
1442+
}
1443+
1444+
[Test]
1445+
public void TestProtocolList1 ()
1446+
{
1447+
var tld = Decomposer.Decompose ("_$s6Lottie10StrokeNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvgTq", false);
1448+
Assert.IsNotNull (tld, "failed decomposition");
1449+
var tlf = tld as TLFunction;
1450+
Assert.IsNotNull (tlf, "not a function");
1451+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1452+
Assert.IsNotNull (ret, "not a protocol list");
1453+
Assert.AreEqual (2, ret.Protocols.Count);
1454+
}
1455+
1456+
[Test]
1457+
public void TestProtocolList2 ()
1458+
{
1459+
var tld = Decomposer.Decompose ("_$s6Lottie10StrokeNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvpMV", false);
1460+
Assert.IsNotNull (tld, "failed decomposition");
1461+
var tlf = tld as TLPropertyDescriptor;
1462+
Assert.IsNotNull (tlf, "not a prop descriptor");
1463+
var proptype = tlf.OfType as SwiftProtocolListType;
1464+
Assert.IsNotNull (proptype);
1465+
Assert.AreEqual (2, proptype.Protocols.Count);
1466+
}
1467+
1468+
[Test]
1469+
public void TestProtocolList3 ()
1470+
{
1471+
var tld = Decomposer.Decompose ("_$s6Lottie10StrokeNodeC8rendererAA0C6Output_AA10Renderablepvg", false);
1472+
Assert.IsNotNull (tld, "failed decomposition");
1473+
var tlf = tld as TLFunction;
1474+
Assert.IsNotNull (tlf, "not a function");
1475+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1476+
Assert.IsNotNull (ret, "not a protocol list");
1477+
Assert.AreEqual (2, ret.Protocols.Count);
1478+
}
1479+
1480+
[Test]
1481+
public void TestProtocolList4 ()
1482+
{
1483+
var tld = Decomposer.Decompose ("_$s6Lottie10StrokeNodeC8rendererAA0C6Output_AA10RenderablepvgTq", false);
1484+
Assert.IsNotNull (tld, "failed decomposition");
1485+
var tlf = tld as TLFunction;
1486+
Assert.IsNotNull (tlf, "not a function");
1487+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1488+
Assert.IsNotNull (ret, "not a protocol list");
1489+
Assert.AreEqual (2, ret.Protocols.Count);
1490+
}
1491+
1492+
[Test]
1493+
public void TestProtocolList5 ()
1494+
{
1495+
var tld = Decomposer.Decompose ("_$s6Lottie10StrokeNodeC8rendererAA0C6Output_AA10RenderablepvpMV", false);
1496+
Assert.IsNotNull (tld, "failed decomposition");
1497+
var tlf = tld as TLPropertyDescriptor;
1498+
Assert.IsNotNull (tlf, "not a prop descriptor");
1499+
var proptype = tlf.OfType as SwiftProtocolListType;
1500+
Assert.IsNotNull (proptype);
1501+
Assert.AreEqual (2, proptype.Protocols.Count);
1502+
}
1503+
1504+
[Test]
1505+
public void TestProtocolList6 ()
1506+
{
1507+
var tld = Decomposer.Decompose ("_$s6Lottie11EllipseNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvg", false);
1508+
Assert.IsNotNull (tld, "failed decomposition");
1509+
var tlf = tld as TLFunction;
1510+
Assert.IsNotNull (tlf, "not a function");
1511+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1512+
Assert.IsNotNull (ret, "not a protocol list");
1513+
Assert.AreEqual (2, ret.Protocols.Count);
1514+
}
1515+
1516+
[Test]
1517+
public void TestProtocolList7 ()
1518+
{
1519+
var tld = Decomposer.Decompose ("_$s6Lottie11EllipseNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvgTq", false);
1520+
Assert.IsNotNull (tld, "failed decomposition");
1521+
var tlf = tld as TLFunction;
1522+
Assert.IsNotNull (tlf, "not a function");
1523+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1524+
Assert.IsNotNull (ret, "not a protocol list");
1525+
Assert.AreEqual (2, ret.Protocols.Count);
1526+
}
1527+
1528+
[Test]
1529+
public void TestProtocolList8 ()
1530+
{
1531+
var tld = Decomposer.Decompose ("_$s6Lottie11EllipseNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvpMV", false);
1532+
Assert.IsNotNull (tld, "failed decomposition");
1533+
var tlf = tld as TLPropertyDescriptor;
1534+
Assert.IsNotNull (tlf, "not a prop descriptor");
1535+
var proptype = tlf.OfType as SwiftProtocolListType;
1536+
Assert.IsNotNull (proptype);
1537+
Assert.AreEqual (2, proptype.Protocols.Count);
1538+
}
1539+
1540+
[Test]
1541+
public void TestProtocolList9 ()
1542+
{
1543+
var tld = Decomposer.Decompose ("_$s6Lottie11PolygonNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvg", false);
1544+
Assert.IsNotNull (tld, "failed decomposition");
1545+
var tlf = tld as TLFunction;
1546+
Assert.IsNotNull (tlf, "not a function");
1547+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1548+
Assert.IsNotNull (ret, "not a protocol list");
1549+
Assert.AreEqual (2, ret.Protocols.Count);
1550+
}
1551+
1552+
[Test]
1553+
public void TestProtocolList10 ()
1554+
{
1555+
var tld = Decomposer.Decompose ("_$s6Lottie11PolygonNodeC11propertyMapAA17KeypathSearchable_AA0c8PropertyE0pvgTq", false);
1556+
Assert.IsNotNull (tld, "failed decomposition");
1557+
var tlf = tld as TLFunction;
1558+
Assert.IsNotNull (tlf, "not a function");
1559+
var ret = tlf.Signature.ReturnType as SwiftProtocolListType;
1560+
Assert.IsNotNull (ret, "not a protocol list");
1561+
Assert.AreEqual (2, ret.Protocols.Count);
1562+
}
14311563
}
14321564
}

0 commit comments

Comments
 (0)