Skip to content

Commit f8dd4ee

Browse files
committed
async regen
1 parent d04dd38 commit f8dd4ee

File tree

1 file changed

+8
-2
lines changed
  • src/NHibernate.Test/Async/NHSpecificTest/GH2029

1 file changed

+8
-2
lines changed

src/NHibernate.Test/Async/NHSpecificTest/GH2029/Fixture.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ protected override void OnTearDown()
8888
[Test]
8989
public async Task NullableIntOverflowAsync()
9090
{
91+
var hasCast = Dialect.GetCastTypeName(NHibernateUtil.Int32.SqlType) !=
92+
Dialect.GetCastTypeName(NHibernateUtil.Int64.SqlType);
93+
9194
using (var session = OpenSession())
9295
using (session.BeginTransaction())
9396
using (var sqlLog = new SqlLogSpy())
@@ -100,7 +103,7 @@ public async Task NullableIntOverflowAsync()
100103
})
101104
.ToListAsync());
102105

103-
Assert.That(FindAllOccurrences(sqlLog.GetWholeLog(), "cast"), Is.EqualTo(1));
106+
Assert.That(FindAllOccurrences(sqlLog.GetWholeLog(), "cast"), Is.EqualTo(hasCast ? 1 : 0));
104107
Assert.That(groups, Has.Count.EqualTo(1));
105108
Assert.That(groups[0].s, Is.EqualTo((long) int.MaxValue * 2));
106109
}
@@ -109,6 +112,9 @@ public async Task NullableIntOverflowAsync()
109112
[Test]
110113
public async Task IntOverflowAsync()
111114
{
115+
var hasCast = Dialect.GetCastTypeName(NHibernateUtil.Int32.SqlType) !=
116+
Dialect.GetCastTypeName(NHibernateUtil.Int64.SqlType);
117+
112118
using (var session = OpenSession())
113119
using (session.BeginTransaction())
114120
using (var sqlLog = new SqlLogSpy())
@@ -121,7 +127,7 @@ public async Task IntOverflowAsync()
121127
})
122128
.ToListAsync());
123129

124-
Assert.That(FindAllOccurrences(sqlLog.GetWholeLog(), "cast"), Is.EqualTo(1));
130+
Assert.That(FindAllOccurrences(sqlLog.GetWholeLog(), "cast"), Is.EqualTo(hasCast ? 1 : 0));
125131
Assert.That(groups, Has.Count.EqualTo(1));
126132
Assert.That(groups[0].s, Is.EqualTo((long) int.MaxValue * 3));
127133
}

0 commit comments

Comments
 (0)