Skip to content
Snippets Groups Projects
Commit 55cda9bf authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

fix message partitioner test errors

parent cc3a7b23
Branches
Tags
3 merge requests!510Release,!226WIP: Api2.0,!207WIP: Client Restructure
...@@ -27,7 +27,7 @@ var expectedMP = messagePart{ ...@@ -27,7 +27,7 @@ var expectedMP = messagePart{
// Tests that a new function part is successfully created. // Tests that a new function part is successfully created.
func Test_newMessagePart(t *testing.T) { func Test_newMessagePart(t *testing.T) {
testStr := []byte{'t', 'e', 's', 't', 'i', 'n', 'g'} testStr := []byte{'t', 'e', 's', 't', 'i', 'n', 'g'}
goTmp := newMessagePart(32, 6, testStr, len(testStr)) goTmp := newMessagePart(32, 6, testStr, len(testStr)+8)
if !reflect.DeepEqual(goTmp, expectedMP) { if !reflect.DeepEqual(goTmp, expectedMP) {
t.Errorf("MessagePart received and MessagePart expected do not match."+ t.Errorf("MessagePart received and MessagePart expected do not match."+
"\nexpected: %#v\nreceived: %#v", expectedMP, goTmp) "\nexpected: %#v\nreceived: %#v", expectedMP, goTmp)
......
...@@ -70,7 +70,7 @@ func TestPartitioner_Partition(t *testing.T) { ...@@ -70,7 +70,7 @@ func TestPartitioner_Partition(t *testing.T) {
// Test that Partitioner.HandlePartition can handle a message part. // Test that Partitioner.HandlePartition can handle a message part.
func TestPartitioner_HandlePartition(t *testing.T) { func TestPartitioner_HandlePartition(t *testing.T) {
p := NewPartitioner(versioned.NewKV(ekv.MakeMemstore()), 256) p := NewPartitioner(versioned.NewKV(ekv.MakeMemstore()), 256)
m := newMessagePart(1107, 1, []byte(ipsumTestStr), 256) m := newMessagePart(1107, 1, []byte(ipsumTestStr), len(ipsumTestStr)+32)
_, _ = p.HandlePartition( _, _ = p.HandlePartition(
&id.DummyUser, &id.DummyUser,
...@@ -83,7 +83,8 @@ func TestPartitioner_HandlePartition(t *testing.T) { ...@@ -83,7 +83,8 @@ func TestPartitioner_HandlePartition(t *testing.T) {
func TestPartitioner_HandleFirstPartition(t *testing.T) { func TestPartitioner_HandleFirstPartition(t *testing.T) {
p := NewPartitioner(versioned.NewKV(ekv.MakeMemstore()), 256) p := NewPartitioner(versioned.NewKV(ekv.MakeMemstore()), 256)
m := newFirstMessagePart( m := newFirstMessagePart(
catalog.XxMessage, 1107, 1, netTime.Now(), []byte(ipsumTestStr), 256) catalog.XxMessage, 1107, 1, netTime.Now(), []byte(ipsumTestStr),
len(ipsumTestStr)+32)
_, _ = p.HandlePartition( _, _ = p.HandlePartition(
&id.DummyUser, &id.DummyUser,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment