X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/c8bfd6061f5079f6c6c0155a2de1e8cd32d8a39a..9c44621ee1ca9abfca79c593e80193afd9204c83:/hotline/transaction_handlers_test.go?ds=inline diff --git a/hotline/transaction_handlers_test.go b/hotline/transaction_handlers_test.go index 01880f2..b03e3b1 100644 --- a/hotline/transaction_handlers_test.go +++ b/hotline/transaction_handlers_test.go @@ -768,7 +768,6 @@ func TestHandleGetFileInfo(t *testing.T) { NewField(FieldFileName, []byte("testfile.txt")), NewField(FieldFileTypeString, []byte("Text File")), NewField(FieldFileCreatorString, []byte("ttxt")), - NewField(FieldFileComment, []byte{}), NewField(FieldFileType, []byte("TEXT")), NewField(FieldFileCreateDate, make([]byte, 8)), NewField(FieldFileModifyDate, make([]byte, 8)), @@ -791,8 +790,8 @@ func TestHandleGetFileInfo(t *testing.T) { // Clear the fileWrapper timestamp fields to work around problems running the tests in multiple timezones // TODO: revisit how to test this by mocking the stat calls + gotRes[0].Fields[4].Data = make([]byte, 8) gotRes[0].Fields[5].Data = make([]byte, 8) - gotRes[0].Fields[6].Data = make([]byte, 8) if !assert.Equal(t, tt.wantRes, gotRes) { t.Errorf("HandleGetFileInfo() gotRes = %v, want %v", gotRes, tt.wantRes) } @@ -1405,7 +1404,7 @@ func TestHandleGetUser(t *testing.T) { ErrorCode: []byte{0, 0, 0, 0}, Fields: []Field{ NewField(FieldUserName, []byte("Guest")), - NewField(FieldUserLogin, negateString([]byte("guest"))), + NewField(FieldUserLogin, encodeString([]byte("guest"))), NewField(FieldUserPassword, []byte("password")), NewField(FieldUserAccess, []byte{0, 0, 0, 0, 0, 0, 0, 0}), }, @@ -1533,7 +1532,7 @@ func TestHandleDeleteUser(t *testing.T) { }, t: NewTransaction( TranDeleteUser, &[]byte{0, 1}, - NewField(FieldUserLogin, negateString([]byte("testuser"))), + NewField(FieldUserLogin, encodeString([]byte("testuser"))), ), }, wantRes: []Transaction{ @@ -1564,7 +1563,7 @@ func TestHandleDeleteUser(t *testing.T) { }, t: NewTransaction( TranDeleteUser, &[]byte{0, 1}, - NewField(FieldUserLogin, negateString([]byte("testuser"))), + NewField(FieldUserLogin, encodeString([]byte("testuser"))), ), }, wantRes: []Transaction{ @@ -2438,7 +2437,7 @@ func TestHandleSendInstantMsg(t *testing.T) { }, }, }, - wantErr: assert.NoError, + wantErr: assert.Error, }, { name: "when client 1 sends a message to client 2",