Skip to content

Commit 5c67d56

Browse files
committed
test: avoid using floats whose rounding is affected by valgrind
Without valgrind, "1.4" is inserted as 1.39999999999999991118, but with valgrind it is inserted as 1.40000000000000013323. Let's just use "1.5".
1 parent 7569b46 commit 5c67d56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_integration_statement.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ def test_bind_param_by_name_good
7777
def test_bind_param_with_various_types
7878
@db.transaction do
7979
@db.execute "create table all_types ( a integer primary key, b float, c string, d integer )"
80-
@db.execute "insert into all_types ( b, c, d ) values ( 1.4, 'hello', 68719476735 )"
80+
@db.execute "insert into all_types ( b, c, d ) values ( 1.5, 'hello', 68719476735 )"
8181
end
8282

83-
assert_equal 1, @db.execute( "select * from all_types where b = ?", 1.4 ).length
83+
assert_equal 1, @db.execute( "select * from all_types where b = ?", 1.5 ).length
8484
assert_equal 1, @db.execute( "select * from all_types where c = ?", 'hello').length
8585
assert_equal 1, @db.execute( "select * from all_types where d = ?", 68719476735).length
8686
end

0 commit comments

Comments
 (0)