MCPcopy
hub / github.com/go-sql-driver/mysql / TestUint64

Function TestUint64

driver_test.go:1227–1268  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1225}
1226
1227func TestUint64(t *testing.T) {
1228 const (
1229 u0 = uint64(0)
1230 uall = ^u0
1231 uhigh = uall >> 1
1232 utop = ^uhigh
1233 s0 = int64(0)
1234 sall = ^s0
1235 shigh = int64(uhigh)
1236 stop = ^shigh
1237 )
1238 runTestsParallel(t, dsn, func(dbt *DBTest, _ string) {
1239 stmt, err := dbt.db.Prepare(`SELECT ?, ?, ? ,?, ?, ?, ?, ?`)
1240 if err != nil {
1241 dbt.Fatal(err)
1242 }
1243 defer stmt.Close()
1244 row := stmt.QueryRow(
1245 u0, uhigh, utop, uall,
1246 s0, shigh, stop, sall,
1247 )
1248
1249 var ua, ub, uc, ud uint64
1250 var sa, sb, sc, sd int64
1251
1252 err = row.Scan(&ua, &ub, &uc, &ud, &sa, &sb, &sc, &sd)
1253 if err != nil {
1254 dbt.Fatal(err)
1255 }
1256 switch {
1257 case ua != u0,
1258 ub != uhigh,
1259 uc != utop,
1260 ud != uall,
1261 sa != s0,
1262 sb != shigh,
1263 sc != stop,
1264 sd != sall:
1265 dbt.Fatal("unexpected result value")
1266 }
1267 })
1268}
1269
1270func TestLongData(t *testing.T) {
1271 runTests(t, dsn+"&maxAllowedPacket=0", func(dbt *DBTest) {

Callers

nothing calls this directly

Calls 4

runTestsParallelFunction · 0.85
PrepareMethod · 0.80
ScanMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected