Adapt to changes in Go names for private methods. Downcase the first letter of Go method names as required by recent API changes for Go bindings for private methods. Such methods are only called from internal code and tests.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/6f8c28fa Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/6f8c28fa Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/6f8c28fa Branch: refs/heads/master Commit: 6f8c28faa333116ee46b99eff81b4c4de855e1aa Parents: d442877 Author: Marvin Humphrey <[email protected]> Authored: Tue Nov 3 18:49:09 2015 -0800 Committer: Marvin Humphrey <[email protected]> Committed: Fri Nov 6 19:03:00 2015 -0800 ---------------------------------------------------------------------- runtime/go/clownfish/bytebuf_test.go | 34 +++++++++++++++---------------- runtime/go/clownfish/charbuf_test.go | 16 +++++++-------- runtime/go/clownfish/class_test.go | 4 ++-- runtime/go/clownfish/hash_test.go | 4 ++-- runtime/go/clownfish/method_test.go | 10 ++++----- runtime/go/clownfish/string_test.go | 2 +- runtime/go/clownfish/vector_test.go | 2 +- 7 files changed, 36 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f8c28fa/runtime/go/clownfish/bytebuf_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/bytebuf_test.go b/runtime/go/clownfish/bytebuf_test.go index 0854f8d..66c9772 100644 --- a/runtime/go/clownfish/bytebuf_test.go +++ b/runtime/go/clownfish/bytebuf_test.go @@ -22,8 +22,8 @@ import "reflect" func TestByteBufCat(t *testing.T) { bb := NewByteBuf(0) content := []byte("foo") - bb.Cat(content) - if got := bb.YieldBlob(); !reflect.DeepEqual(got, content) { + bb.cat(content) + if got := bb.yieldBlob(); !reflect.DeepEqual(got, content) { t.Errorf("Expected %v, got %v", content, got) } } @@ -31,20 +31,20 @@ func TestByteBufCat(t *testing.T) { func TestByteBufSetSizeGetSize(t *testing.T) { bb := NewByteBuf(0) content := []byte("abc") - bb.Cat(content) - bb.SetSize(2) - if got := bb.GetSize(); got != 2 { + bb.cat(content) + bb.setSize(2) + if got := bb.getSize(); got != 2 { t.Errorf("Expected size 2, got %d", got) } expected := []byte("ab") - if got := bb.YieldBlob(); !reflect.DeepEqual(got, expected) { + if got := bb.yieldBlob(); !reflect.DeepEqual(got, expected) { t.Errorf("Expected %v, got %v", expected, got) } } func TestByteBufGetCapacity(t *testing.T) { bb := NewByteBuf(5) - if cap := bb.GetCapacity(); cap < 5 { + if cap := bb.getCapacity(); cap < 5 { t.Errorf("Expected at least 5, got %d", cap) } } @@ -52,10 +52,10 @@ func TestByteBufGetCapacity(t *testing.T) { func TestByteBufMimic(t *testing.T) { bb := NewByteBuf(0) content := []byte("foo") - bb.Cat(content) + bb.cat(content) other := NewByteBuf(0) other.Mimic(bb) - if got := other.YieldBlob(); !reflect.DeepEqual(got, content) { + if got := other.yieldBlob(); !reflect.DeepEqual(got, content) { t.Errorf("Expected %v, got %v", content, got) } } @@ -64,12 +64,12 @@ func TestByteBufEquals(t *testing.T) { bb := NewByteBuf(0) other := NewByteBuf(0) content := []byte("foo") - bb.Cat(content) - other.Cat(content) + bb.cat(content) + other.cat(content) if !bb.Equals(other) { t.Errorf("Equals against equal ByteBuf") } - other.SetSize(2) + other.setSize(2) if bb.Equals(other) { t.Errorf("Equals against non-equal ByteBuf") } @@ -81,9 +81,9 @@ func TestByteBufEquals(t *testing.T) { func TestByteBufClone(t *testing.T) { content := []byte("foo") bb := NewByteBuf(0) - bb.Cat(content) + bb.cat(content) clone := bb.Clone().(ByteBuf) - if got := clone.YieldBlob(); !reflect.DeepEqual(got, content) { + if got := clone.yieldBlob(); !reflect.DeepEqual(got, content) { t.Errorf("Expected %v, got %v", content, got) } } @@ -92,12 +92,12 @@ func TestByteBufCompareTo(t *testing.T) { bb := NewByteBuf(0) other := NewByteBuf(0) content := []byte("foo") - bb.Cat(content) - other.Cat(content) + bb.cat(content) + other.cat(content) if got := bb.CompareTo(other); got != 0 { t.Errorf("CompareTo equal, got %d", got) } - other.SetSize(2) + other.setSize(2) if got := bb.CompareTo(other); got <= 0 { t.Errorf("CompareTo lesser, got %d", got) } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f8c28fa/runtime/go/clownfish/charbuf_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/charbuf_test.go b/runtime/go/clownfish/charbuf_test.go index 1ade2f2..27c2b03 100644 --- a/runtime/go/clownfish/charbuf_test.go +++ b/runtime/go/clownfish/charbuf_test.go @@ -20,7 +20,7 @@ import "testing" func TestCharBufCat(t *testing.T) { cb := NewCharBuf(0) - cb.Cat("foo") + cb.cat("foo") if got := cb.ToString(); got != "foo" { t.Errorf("Expected foo, got %v", got) } @@ -29,7 +29,7 @@ func TestCharBufCat(t *testing.T) { func TestCharBufMimic(t *testing.T) { cb := NewCharBuf(0) other := NewCharBuf(0) - other.Cat("foo") + other.cat("foo") cb.Mimic(other) if got := cb.ToString(); got != "foo" { t.Errorf("Expected foo, got %v", got) @@ -38,7 +38,7 @@ func TestCharBufMimic(t *testing.T) { func TestCharBufCatChar(t *testing.T) { cb := NewCharBuf(0) - cb.CatChar('x') + cb.catChar('x') if got := cb.ToString(); got != "x" { t.Errorf("Expected x, got %v", got) } @@ -46,9 +46,9 @@ func TestCharBufCatChar(t *testing.T) { func TestCharBufSetSizeGetSize(t *testing.T) { cb := NewCharBuf(0) - cb.Cat("abc") - cb.SetSize(2) - if got := cb.GetSize(); got != 2 { + cb.cat("abc") + cb.setSize(2) + if got := cb.getSize(); got != 2 { t.Errorf("Size should be 2 but got %d", got) } if got := cb.ToString(); got != "ab" { @@ -58,7 +58,7 @@ func TestCharBufSetSizeGetSize(t *testing.T) { func TestCharBufClone(t *testing.T) { cb := NewCharBuf(0) - cb.Cat("foo") + cb.cat("foo") clone := cb.Clone() if got := clone.ToString(); got != "foo" { t.Errorf("Expected foo, got %v", got) @@ -67,7 +67,7 @@ func TestCharBufClone(t *testing.T) { func TestCharBufYieldString(t *testing.T) { cb := NewCharBuf(0) - cb.Cat("foo") + cb.cat("foo") if got := cb.YieldString(); got != "foo" { t.Errorf("Should yield foo, got %v", got) } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f8c28fa/runtime/go/clownfish/class_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/class_test.go b/runtime/go/clownfish/class_test.go index 3b1bd5c..1099452 100644 --- a/runtime/go/clownfish/class_test.go +++ b/runtime/go/clownfish/class_test.go @@ -37,8 +37,8 @@ func TestClassGetParent(t *testing.T) { func TestClassGetObjAllocSize(t *testing.T) { intClass := FetchClass("Clownfish::Integer") classClass := FetchClass("Clownfish::Class") - if intClass.GetObjAllocSize() >= classClass.GetObjAllocSize() { - t.Error("Unexpected result for GetObjAllocSize") + if intClass.getObjAllocSize() >= classClass.getObjAllocSize() { + t.Error("Unexpected result for getObjAllocSize") } } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f8c28fa/runtime/go/clownfish/hash_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/hash_test.go b/runtime/go/clownfish/hash_test.go index 26acf49..a36c99b 100644 --- a/runtime/go/clownfish/hash_test.go +++ b/runtime/go/clownfish/hash_test.go @@ -98,8 +98,8 @@ func TestHashValues(t *testing.T) { func TestGetCapacity(t *testing.T) { hash := NewHash(1) - if cap := hash.GetCapacity(); cap <= 1 { - t.Errorf("Unexpected value for GetCapacity: %d", cap) + if cap := hash.getCapacity(); cap <= 1 { + t.Errorf("Unexpected value for getCapacity: %d", cap) } } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f8c28fa/runtime/go/clownfish/method_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/method_test.go b/runtime/go/clownfish/method_test.go index 3e3d1f6..0f9e47c 100644 --- a/runtime/go/clownfish/method_test.go +++ b/runtime/go/clownfish/method_test.go @@ -21,7 +21,7 @@ import "unsafe" func TestMethodGetName(t *testing.T) { meth := NewMethod("Do_Stuff", unsafe.Pointer(nil), 32) - if name := meth.GetName(); name != "Do_Stuff" { + if name := meth.getName(); name != "Do_Stuff" { t.Errorf("Expected \"Do_Stuff\", got %s", name) } } @@ -29,8 +29,8 @@ func TestMethodGetName(t *testing.T) { func TestMethodGetHostAlias(t *testing.T) { meth := NewMethod("Do_Stuff", unsafe.Pointer(nil), 32) alias := "GetStuffDone" - meth.SetHostAlias(alias) - if got := meth.GetHostAlias(); got != alias { + meth.setHostAlias(alias) + if got := meth.getHostAlias(); got != alias { t.Errorf("Expected %v, got %v", alias, got) } } @@ -38,14 +38,14 @@ func TestMethodGetHostAlias(t *testing.T) { func TestMethodHostName(t *testing.T) { meth := NewMethod("Do_Stuff", unsafe.Pointer(nil), 32) expected := "DoStuff" - if hostName := meth.HostName(); hostName != expected { + if hostName := meth.hostName(); hostName != expected { t.Errorf("Expected %v, got %v", expected, hostName) } } func TestMethodIsExcludedFromHost(t *testing.T) { meth := NewMethod("Do_Stuff", unsafe.Pointer(nil), 32) - if meth.IsExcludedFromHost() { + if meth.isExcludedFromHost() { t.Errorf("Meth should not be excluded") } } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f8c28fa/runtime/go/clownfish/string_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/string_test.go b/runtime/go/clownfish/string_test.go index cdfad20..f5a81c6 100644 --- a/runtime/go/clownfish/string_test.go +++ b/runtime/go/clownfish/string_test.go @@ -148,7 +148,7 @@ func TestStringClone(t *testing.T) { func TestStringHashSum(t *testing.T) { // Test compilation only. s := NewString("foo") - var _ uintptr = s.HashSum() + var _ uintptr = s.hashSum() } func TestStringToString(t *testing.T) { http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/6f8c28fa/runtime/go/clownfish/vector_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/vector_test.go b/runtime/go/clownfish/vector_test.go index 719b5d1..eb2f185 100644 --- a/runtime/go/clownfish/vector_test.go +++ b/runtime/go/clownfish/vector_test.go @@ -148,7 +148,7 @@ func TestVecGetSize(t *testing.T) { func TestVecGetCapacity(t *testing.T) { vec := NewVector(10) - cap := vec.GetCapacity() + cap := vec.getCapacity() if cap != 10 { t.Errorf("Unexpected capacity: %v", cap) }
