susumu.yata
null+****@clear*****
Mon Jun 22 15:46:43 JST 2015
susumu.yata 2015-06-22 15:46:43 +0900 (Mon, 22 Jun 2015) New Revision: 4686dd9e964c0d2004df4dcc0ae2c598541e0d56 https://github.com/groonga/grngo/commit/4686dd9e964c0d2004df4dcc0ae2c598541e0d56 Message: Add tests for setting (U)IntXX values. GitHub: #5 Modified files: grngo_test.go Modified: grngo_test.go (+43 -1) =================================================================== --- grngo_test.go 2015-06-22 15:44:05 +0900 (d14dc06) +++ grngo_test.go 2015-06-22 15:46:43 +0900 (a25ce05) @@ -495,8 +495,22 @@ func generateRandomValue(valueType string) interface{} { switch valueType { case "Bool": return (rand.Int() & 1) == 1 + case "Int8": + return int64(int8(rand.Int())) + case "Int16": + return int64(int16(rand.Int())) + case "Int32": + return int64(int32(rand.Int())) case "Int64": return rand.Int63() + case "UInt8": + return int64(uint8(rand.Int())) + case "UInt16": + return int64(uint16(rand.Int())) + case "UInt32": + return int64(rand.Uint32()) + case "UInt64": + return rand.Int63() case "Float": return rand.Float64() case "WGS84GeoPoint": @@ -606,10 +620,38 @@ func TestColumnSetValueForBool(t *testing.T) { testColumnSetValueForScalar(t, "Bool") } -func TestColumnSetValueForInt(t *testing.T) { +func TestColumnSetValueForInt8(t *testing.T) { + testColumnSetValueForScalar(t, "Int8") +} + +func TestColumnSetValueForInt16(t *testing.T) { + testColumnSetValueForScalar(t, "Int16") +} + +func TestColumnSetValueForInt32(t *testing.T) { + testColumnSetValueForScalar(t, "Int32") +} + +func TestColumnSetValueForInt64(t *testing.T) { testColumnSetValueForScalar(t, "Int64") } +func TestColumnSetValueForUInt8(t *testing.T) { + testColumnSetValueForScalar(t, "UInt8") +} + +func TestColumnSetValueForUInt16(t *testing.T) { + testColumnSetValueForScalar(t, "UInt16") +} + +func TestColumnSetValueForUInt32(t *testing.T) { + testColumnSetValueForScalar(t, "UInt32") +} + +func TestColumnSetValueForUInt64(t *testing.T) { + testColumnSetValueForScalar(t, "UInt64") +} + func TestColumnSetValueForFloat(t *testing.T) { testColumnSetValueForScalar(t, "Float") } -------------- next part -------------- HTML����������������������������...Download