Skip to content

Commit 2c28e49

Browse files
author
sridharn
committed
Skip TestBitmap that only fails in the mono runtime for now.
1 parent 147d512 commit 2c28e49

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

DriverOnlineTests/DriverOnlineTests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@
7979
<Compile Include="..\GlobalAssemblyInfo.cs">
8080
<Link>Properties\GlobalAssemblyInfo.cs</Link>
8181
</Compile>
82+
<Compile Include="..\TestEnvironment.cs">
83+
<Link>TestEnvironment.cs</Link>
84+
</Compile>
8285
<Compile Include="Core\CommandResults\CollectionStatsResultTests.cs" />
8386
<Compile Include="Core\CommandResults\CommandResultTests.cs" />
8487
<Compile Include="Core\CommandResults\DatabaseStatsResultTests.cs" />

DriverOnlineTests/Jira/CSharp355Tests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
using MongoDB.Bson.Serialization.Attributes;
2929
using MongoDB.Driver;
3030
using MongoDB.Driver.Builders;
31+
using MongoDB.UnitTests;
3132

3233
namespace MongoDB.DriverOnlineTests.Jira.CSharp355
3334
{
@@ -57,6 +58,12 @@ public void TestFixtureSetup()
5758
[Test]
5859
public void TestBitmap()
5960
{
61+
if (TestEnvironment.MonoRuntime)
62+
{
63+
// this test does not work in Mono. Skipping for the time being
64+
// CSHARP-389
65+
return;
66+
}
6067
var bitmap = new Bitmap(1, 2);
6168
var c = new C { I = bitmap, B = bitmap };
6269
_collection.RemoveAll();

TestEnvironment.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/* Copyright 2010-2011 10gen Inc.
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
using System;
17+
18+
namespace MongoDB.UnitTests
19+
{
20+
internal class TestEnvironment
21+
{
22+
private static bool _monoRuntime = false;
23+
24+
static TestEnvironment()
25+
{
26+
var type = Type.GetType("Mono.Runtime");
27+
if (type != null)
28+
{
29+
_monoRuntime = true;
30+
}
31+
}
32+
33+
/// <summary>
34+
/// Check to see if the code is being executed on the Mono runtime as opposed to the normal
35+
/// Microsoft .Net runtime
36+
/// @returns true if running in Mono
37+
/// </summary>
38+
internal static bool MonoRuntime
39+
{
40+
get { return _monoRuntime; }
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)