|
From: <ste...@us...> - 2010-07-07 08:39:31
|
Revision: 5001
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5001&view=rev
Author: steverstrong
Date: 2010-07-07 08:39:24 +0000 (Wed, 07 Jul 2010)
Log Message:
-----------
Added more bitwise tests and fixed silly bug in tree builder
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs
trunk/nhibernate/src/NHibernate.Test/DbScripts/MsSql2008DialectLinqReadonlyCreateScript.sql
trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs
Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs 2010-07-06 20:05:52 UTC (rev 5000)
+++ trunk/nhibernate/src/NHibernate/Hql/Ast/HqlTreeNode.cs 2010-07-07 08:39:24 UTC (rev 5001)
@@ -708,7 +708,7 @@
public class HqlBitwiseOr : HqlExpression
{
public HqlBitwiseOr(IASTFactory factory, HqlExpression lhs, HqlExpression rhs)
- : base(HqlSqlWalker.BAND, "band", factory, lhs, rhs)
+ : base(HqlSqlWalker.BOR, "bor", factory, lhs, rhs)
{
}
}
@@ -716,7 +716,7 @@
public class HqlBitwiseAnd : HqlExpression
{
public HqlBitwiseAnd(IASTFactory factory, HqlExpression lhs, HqlExpression rhs)
- : base(HqlSqlWalker.BOR, "bor", factory, lhs, rhs)
+ : base(HqlSqlWalker.BAND, "band", factory, lhs, rhs)
{
}
}
Modified: trunk/nhibernate/src/NHibernate.Test/DbScripts/MsSql2008DialectLinqReadonlyCreateScript.sql
===================================================================
(Binary files differ)
Modified: trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-07-06 20:05:52 UTC (rev 5000)
+++ trunk/nhibernate/src/NHibernate.Test/Linq/WhereTests.cs 2010-07-07 08:39:24 UTC (rev 5001)
@@ -423,5 +423,28 @@
Assert.IsNotNull(query);
}
+
+ [Test]
+ public void BitwiseQuery2()
+ {
+ var featureSet = FeatureSet.HasAll;
+ var query = (from o in session.Query<User>()
+ where (o.Features & featureSet) == featureSet
+ select o).ToList();
+
+ Assert.AreEqual(1, query.Count);
+ }
+
+ [Test]
+ public void BitwiseQuery3()
+ {
+ var featureSet = FeatureSet.HasThat;
+ var query = (from o in session.Query<User>()
+ where ((o.Features | featureSet) & featureSet) == featureSet
+ select o).ToList();
+
+ Assert.AreEqual(3, query.Count);
+ }
+
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|