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

Commit 122393f

Browse files
Ensure that XamGlue.framework is available
1 parent bb0327a commit 122393f

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

tests/tom-swifty-test/SwiftRuntimeLibraryTests/SwiftArrayTests.cs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@ public SwiftArrayTests ()
2222
Assert.Ignore ("These tests are 64-bit only. Run from the command line instead if you're trying from the IDE."); // At least on macOS, because we don't build our swift libraries for 32-bit macOS.
2323
}
2424

25+
[OneTimeSetUp]
26+
public void FixtureSetup ()
27+
{
28+
CopyXamGlueFramework ();
29+
}
30+
31+
static void CopyXamGlueFramework ()
32+
{
33+
var localFramework = Path.Combine (Compiler.kTestRoot, "XamGlue.framework");
34+
if (!Directory.Exists (localFramework)) {
35+
Directory.CreateDirectory (localFramework);
36+
}
37+
var localXamGlue = Path.Combine (localFramework, "XamGlue");
38+
if (!File.Exists (localXamGlue)) {
39+
var remoteXamGlue = Path.Combine (Compiler.kSwiftRuntimeGlueDirectory, "XamGlue");
40+
File.Copy (remoteXamGlue, localXamGlue);
41+
}
42+
}
43+
2544
[Test]
2645
public void DefaultConstructor ()
2746
{
@@ -35,14 +54,15 @@ public void DefaultConstructor ()
3554
public void Constructor_Capacity ()
3655
{
3756
using (var arr = new SwiftArray<byte> ((nint)20)) {
38-
Assert.That (arr.Count, Is.EqualTo (1), "Count 1");
57+
Assert.That (arr.Count, Is.EqualTo (0), "Count 1");
3958
Assert.That (arr.Capacity, Is.GreaterThanOrEqualTo (20), "Capacity 1");
4059
arr.Add (10);
41-
Assert.That (arr.Count, Is.EqualTo (2), "Count 2");
60+
Assert.That (arr.Count, Is.EqualTo (1), "Count 2");
4261
Assert.That (arr.Capacity, Is.GreaterThanOrEqualTo (20), "Capacity 2");
4362
}
4463

45-
Assert.Throws<ArgumentOutOfRangeException> (() => new SwiftArray<int> (-1));
64+
nint badCapacity = -1;
65+
Assert.Throws<ArgumentOutOfRangeException> (() => new SwiftArray<int> (badCapacity));
4666
}
4767

4868
[Test]

0 commit comments

Comments
 (0)