Skip to content

Commit

Permalink
Merge pull request #89 from iskar909/master
Browse files Browse the repository at this point in the history
Fix tests, all tests now passing for unity5 build locally
  • Loading branch information
thelinuxlich committed Aug 28, 2015
2 parents b5fd961 + 615547b commit 34d117e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
12 changes: 10 additions & 2 deletions Artemis_UnitTests/TestGeneral.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,11 @@ public void TestComponentTypeBit()
{
for (int i = 0; i < 32; i++)
{
Assert.AreEqual(1 << i, new ComponentType().Bit);
#if UNITY5
Assert.AreEqual(new BigInteger(1) << i, new ComponentType().Bit);
#else
Assert.AreEqual(BigInteger.One << i, new ComponentType().Bit);
#endif
}
}

Expand Down Expand Up @@ -1076,7 +1080,11 @@ public void TestEntitySystemSystemBit()
{
for (int i = 0; i < 32; i++)
{
Assert.AreEqual(1 << i, systemBitManager.GetBitFor(new TestEntityProcessingSystem()));
#if UNITY5
Assert.AreEqual(new BigInteger(1) << i, systemBitManager.GetBitFor(new TestEntityProcessingSystem()));
#else
Assert.AreEqual(BigInteger.One << i, systemBitManager.GetBitFor(new TestEntityProcessingSystem()));
#endif
}
}

Expand Down
2 changes: 1 addition & 1 deletion Artemis_XNA_INDEPENDENT/Attributes/AttributesProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public class AttributesProcessor
typeof(ArtemisComponentCreate)
};

#if FULLDOTNET || METRO
#if FULLDOTNET || METRO || UNITY5
/// <summary>Processes the specified supported attributes.</summary>
/// <param name="supportedAttributes">The supported attributes.</param>
/// <returns>The Dictionary{TypeList{Attribute}}.</returns>
Expand Down
4 changes: 2 additions & 2 deletions Artemis_XNA_INDEPENDENT/ComponentType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ namespace Artemis
using global::System;
using global::System.Diagnostics;

#if XBOX || WINDOWS_PHONE || PORTABLE || FORCEINT32 || UNITY5
#if XBOX || WINDOWS_PHONE || PORTABLE || FORCEINT32
using BigInteger = global::System.Int32;
#else
#elif !UNITY5
using global::System.Numerics;
#endif
using Artemis.Interface;
Expand Down
2 changes: 1 addition & 1 deletion Artemis_XNA_INDEPENDENT/Manager/ComponentTypeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static ComponentType GetTypeFor(Type component)
/// <param name="assembliesToScan">The assemblies to scan.</param>
public static void Initialize(params Assembly[] assembliesToScan)
{
#if FULLDOTNET || METRO
#if FULLDOTNET || METRO || UNITY5
if (assembliesToScan.Length == 0)
{
assembliesToScan = AppDomain.CurrentDomain.GetAssemblies().ToArray();
Expand Down
2 changes: 1 addition & 1 deletion Artemis_XNA_INDEPENDENT/Manager/SystemManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ internal void InitializeAll(bool processAttributes, IEnumerable<Assembly> assemb
IDictionary<Type, List<Attribute>> types;
if (assembliesToScan == null)
{
#if FULLDOTNET || METRO
#if FULLDOTNET || METRO || UNITY5
types = AttributesProcessor.Process(AttributesProcessor.SupportedAttributes);
#else
types = AttributesProcessor.Process(AttributesProcessor.SupportedAttributes, null);
Expand Down

0 comments on commit 34d117e

Please sign in to comment.