forked from apache/cassandra-gocql-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34fdeeb
commit 6c840db
Showing
3 changed files
with
47 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//go:build fuzz | ||
// +build fuzz | ||
|
||
package gocql | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
// FuzzMarshalFloat64Ptr aimed to repeatedly test float64 marshaling with generated inputs based on seed corpus. | ||
func FuzzMarshalFloat64Ptr(f *testing.F) { | ||
f.Add(float64(7500), float64(7500.00)) | ||
|
||
f.Fuzz(func(t *testing.T, num, numWithPoints float64) { | ||
session := createSession(t, &ClusterConfig{ProtoVersion: protoVersion3}) | ||
Check failure on line 15 in fuzz_cassandra_test.go GitHub Actions / Fuzz tests (1.19)
|
||
|
||
defer session.Close() | ||
|
||
if err := createTable(session, "CREATE TABLE IF NOT EXISTS gocql_test.float_test (id double, test double, primary key (id))"); err != nil { | ||
t.Fatal("create table:", err) | ||
} | ||
|
||
if err := session.Query(`TRUNCATE TABLE gocql_test.float_test`).Exec(); err != nil { | ||
t.Fatal("truncate table:", err) | ||
} | ||
|
||
if err := session.Query(`INSERT INTO float_test (id,test) VALUES (?,?)`, numWithPoints, &num).Exec(); err != nil { | ||
t.Fatal("insert float64:", err) | ||
} | ||
}) | ||
} |