Race test changes.

This commit is contained in:
Alex Bramley 2014-12-31 17:37:08 +00:00
parent c5830d598f
commit ed6eb6115f
1 changed files with 6 additions and 6 deletions

View File

@ -573,13 +573,13 @@ func TestSTRaces(t *testing.T) {
go func(s string) { go func(s string) {
st.NewNick("nick-" + s) st.NewNick("nick-" + s)
c := st.NewChannel("#chan-" + s) c := st.NewChannel("#chan-" + s)
st.Associate(c, st.me) st.Associate(c.Name, "mynick")
wg.Done() wg.Done()
}(string(i)) }(string(i))
go func(s string) { go func(s string) {
n := st.GetNick("nick-" + s) n := st.GetNick("nick-" + s)
c := st.GetChannel("#chan-" + s) c := st.GetChannel("#chan-" + s)
st.Associate(c, n) st.Associate(c.Name, n.Nick)
wg.Done() wg.Done()
}(string(i)) }(string(i))
} }
@ -589,19 +589,19 @@ func TestSTRaces(t *testing.T) {
race := func(ns, cs string) { race := func(ns, cs string) {
wg.Add(5) wg.Add(5)
go func() { go func() {
st.Associate(st.GetChannel("#chan-"+cs), st.GetNick("nick-"+ns)) st.Associate("#chan-"+cs, "nick-"+ns)
wg.Done() wg.Done()
}() }()
go func() { go func() {
st.GetNick("nick-"+ns).Channels() st.GetNick("nick-"+ns)
wg.Done() wg.Done()
}() }()
go func() { go func() {
st.GetChannel("#chan-"+cs).Nicks() st.GetChannel("#chan-"+cs)
wg.Done() wg.Done()
}() }()
go func() { go func() {
st.Dissociate(st.GetChannel("#chan-"+cs), st.GetNick("nick-"+ns)) st.Dissociate("#chan-"+cs, "nick-"+ns)
wg.Done() wg.Done()
}() }()
go func() { go func() {