X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=daemon_test.go;h=3db72cb6b73fee9d3636d6a9a30133ee8e8d5ac9;hb=5a17f44b24340dc970bbbbfb7420fb86f88837b7;hp=d049e42be2f38abe06aad2806b85ed659adddb22;hpb=f46c678ce03915d6f081cf2f78ac7fe885cdb001;p=goircd.git diff --git a/daemon_test.go b/daemon_test.go index d049e42..3db72cb 100644 --- a/daemon_test.go +++ b/daemon_test.go @@ -1,6 +1,6 @@ /* goircd -- minimalistic simple Internet Relay Chat (IRC) server -Copyright (C) 2014 Sergey Matveev +Copyright (C) 2014-2015 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,6 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ + package main import ( @@ -25,11 +26,12 @@ import ( ) func TestRegistrationWorkflow(t *testing.T) { - daemon := NewDaemon("ver1", "foohost", "", nil, nil) + host := "foohost" + daemon := NewDaemon("ver1", &host, nil, nil, nil, nil) events := make(chan ClientEvent) go daemon.Processor(events) conn := NewTestingConn() - client := NewClient("foohost", conn) + client := NewClient(&host, conn) go client.Processor(events) conn.inbound <- "UNEXISTENT CMD" // should recieve nothing on this @@ -119,8 +121,10 @@ func TestMotd(t *testing.T) { fd.WriteString("catched\n") conn := NewTestingConn() - client := NewClient("foohost", conn) - daemon := NewDaemon("ver1", "foohost", fd.Name(), nil, nil) + host := "foohost" + client := NewClient(&host, conn) + motdName := fd.Name() + daemon := NewDaemon("ver1", &host, &motdName, nil, nil, nil) daemon.SendMotd(client) if r := <-conn.outbound; !strings.HasPrefix(r, ":foohost 375") {