Introduce CSSAssertSetFailFunc and CSSAsserFail to throw managed exception
Summary: - Define CSS_ASSERT_FAIL_ENABLED for P/Invoke (Visual Studio project already has it) - Pass managed delegate pointer to unmanaged side via P/Invoke. - CSSAssertFail will call the managed delegate when assert failed. - The delegate will throw managed exception. Reviewed By: emilsjolander Differential Revision: D3982084 fbshipit-source-id: 058a87c10ca89238362be4d8759cc00dd0c9b376
This commit is contained in:
committed by
Facebook Github Bot
parent
90844d62c5
commit
56f6efdecf
@@ -41,6 +41,21 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(0, parent.Count);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException("System.InvalidOperationException")]
|
||||
public void TestCannotAddChildToMultipleParents()
|
||||
{
|
||||
CSSNode parent1 = new CSSNode();
|
||||
parent1.Initialize();
|
||||
CSSNode parent2 = new CSSNode();
|
||||
parent2.Initialize();
|
||||
CSSNode child = new CSSNode();
|
||||
child.Initialize();
|
||||
|
||||
parent1.Insert(0, child);
|
||||
parent2.Insert(0, child);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException("System.InvalidOperationException")]
|
||||
public void TestAlreadyInitialize()
|
||||
|
Reference in New Issue
Block a user