|
From: <fab...@us...> - 2009-04-23 04:17:54
|
Revision: 4203
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4203&view=rev
Author: fabiomaulo
Date: 2009-04-23 04:17:31 +0000 (Thu, 23 Apr 2009)
Log Message:
-----------
Bug fixed
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs
trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BaseFixture.cs
trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs
Modified: trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs 2009-04-23 03:28:22 UTC (rev 4202)
+++ trunk/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Util/LiteralProcessor.cs 2009-04-23 04:17:31 UTC (rev 4203)
@@ -1,4 +1,5 @@
using System;
+using System.Globalization;
using log4net;
using NHibernate.Hql.Ast.ANTLR.Tree;
using NHibernate.Persister.Entity;
@@ -178,11 +179,11 @@
Decimal number;
try
{
- number = Decimal.Parse(literalValue);
+ number = Decimal.Parse(literalValue, NumberFormatInfo.InvariantInfo);
}
catch (Exception t)
{
- throw new HibernateException("Could not parse literal [" + text + "] as big-decimal", t);
+ throw new HibernateException("Could not parse literal [" + text + "] as System.Decimal.", t);
}
return _formatters[DECIMAL_LITERAL_FORMAT].Format(number);
@@ -330,7 +331,7 @@
{
public string Format(Decimal number)
{
- return number.ToString();
+ return number.ToString(NumberFormatInfo.InvariantInfo);
}
}
@@ -347,7 +348,7 @@
}
catch (Exception t)
{
- throw new HibernateException("Unable to format decimal literal in approximate format [" + number.ToString() + "]", t);
+ throw new HibernateException("Unable to format decimal literal in approximate format [" + number.ToString(NumberFormatInfo.InvariantInfo) + "]", t);
}
}
}
Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BaseFixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BaseFixture.cs 2009-04-23 03:28:22 UTC (rev 4202)
+++ trunk/nhibernate/src/NHibernate.Test/HQL/Ast/BaseFixture.cs 2009-04-23 04:17:31 UTC (rev 4203)
@@ -2,6 +2,7 @@
using NHibernate.Hql.Ast.ANTLR;
using System.Collections.Generic;
using NHibernate.Util;
+using NUnit.Framework;
namespace NHibernate.Test.HQL.Ast
{
@@ -9,6 +10,14 @@
{
private readonly IDictionary<string, IFilter> emptyfilters = new CollectionHelper.EmptyMapClass<string, IFilter>();
+ protected override void OnSetUp()
+ {
+ if (!(sessions.Settings.QueryTranslatorFactory is ASTQueryTranslatorFactory))
+ {
+ Assert.Ignore("ASTQueryTranslator specific test");
+ }
+ }
+
#region Overrides of TestCase
protected override IList Mappings
@@ -37,11 +46,5 @@
qt.Compile(null, false);
return qt.SQLString;
}
-
- protected override bool AppliesTo(Dialect.Dialect dialect)
- {
- return sessions.Settings.QueryTranslatorFactory is ASTQueryTranslatorFactory;
- }
-
}
}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs 2009-04-23 03:28:22 UTC (rev 4202)
+++ trunk/nhibernate/src/NHibernate.Test/HQL/Ast/SqlTranslationFixture.cs 2009-04-23 04:17:31 UTC (rev 4203)
@@ -6,10 +6,10 @@
[TestFixture]
public class SqlTranslationFixture : BaseFixture
{
- [Test, Ignore("Bug not fixed yet")]
+ [Test]
public void ParseFloatConstant()
{
- var query = "select 123.5, s from SimpleClass s";
+ const string query = "select 123.5, s from SimpleClass s";
Assert.That(GetSql(query), Text.StartsWith("select 123.5"));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|