ObjIRC  Check-in [7dcca7532e]

Overview
Comment:Update tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7dcca7532edf47daaee740b56e22ea65c9c6746826edc226800f4491bd134160
User & Date: js on 2011-09-09 16:29:46
Other Links: manifest | tags
Context
2011-09-09
16:46
Add support for handling QUIT. check-in: 4e9e1552b6 user: js tags: trunk
16:29
Update tests. check-in: 7dcca7532e user: js tags: trunk
16:23
Add support for handling PART and fix parsing of JOIN. check-in: 92093d341f user: js tags: trunk
Changes

Modified tests/test.m from [acfa00e488] to [ef589643ba].

32
33
34
35
36
37
38
39

40
41
42
43
44
45





46
47
48


49
50
51

52
53
54
55
56
57

58
59
60
61
62
63

64
65

66
67
68

69
70
71
72

73
74








75

76
77
78
79
80

81
82
83

84
85
86
87
88
89
32
33
34
35
36
37
38

39
40





41
42
43
44
45
46


47
48
49
50

51
52
53
54
55
56

57
58
59
60
61
62

63
64

65
66
67

68
69
70
71

72
73
74
75
76
77
78
79
80
81
82

83
84
85
86
87

88
89
90

91
92
93
94
95
96
97







-
+

-
-
-
-
-
+
+
+
+
+

-
-
+
+


-
+





-
+





-
+

-
+


-
+



-
+


+
+
+
+
+
+
+
+
-
+




-
+


-
+






@end

OF_APPLICATION_DELEGATE(TestApp)

@implementation TestApp
- (void)applicationDidFinishLaunching
{
	IRCConnection *conn = [[IRCConnection alloc] init];
	IRCConnection *connection = [[IRCConnection alloc] init];

	conn.server = @"leguin.freenode.net";
	conn.nickname = @"ObjIRC";
	conn.username = @"ObjIRC";
	conn.realname = @"ObjIRC";
	conn.delegate = self;
	connection.server = @"irc.freenode.net";
	connection.nickname = @"ObjIRC";
	connection.username = @"ObjIRC";
	connection.realname = @"ObjIRC";
	connection.delegate = self;

	[conn connect];
	[conn handleConnection];
	[connection connect];
	[connection handleConnection];
}

- (void)connection: (IRCConnection*)conn
- (void)connection: (IRCConnection*)connection
    didReceiveLine: (OFString*)line
{
	[of_stderr writeFormat: @"> %@\n", line];
}

- (void)connection: (IRCConnection*)conn
- (void)connection: (IRCConnection*)connection
       didSendLine: (OFString*)line
{
	[of_stderr writeFormat: @"< %@\n", line];
}

- (void)connectionWasEstablished: (IRCConnection*)conn
- (void)connectionWasEstablished: (IRCConnection*)connection
{
	[conn joinChannel: @"#objfw"];
	[connection joinChannel: @"#objfw"];
}

- (void)connection: (IRCConnection*)conn
- (void)connection: (IRCConnection*)connection
	didSeeUser: (IRCUser*)user
       joinChannel: (IRCChannel*)channel
{
	of_log(@"%@ joined %@.", user, channel.name);
	of_log(@"%@ joined %@.", user, channel);
}

- (void)connection: (IRCConnection*)connection
	didSeeUser: (IRCUser*)user
      leaveChannel: (IRCChannel*)channel
	withReason: (OFString*)reason
{
	of_log(@"%@ left %@ (%@).", user, channel, reason);
}

-  (void)connection: (IRCConnection*)conn
-  (void)connection: (IRCConnection*)connection
  didReceiveMessage: (OFString*)msg
	   fromUser: (IRCUser*)user
	  inChannel: (IRCChannel*)channel
{
	of_log(@"[%@] %@: %@", channel.name, user, msg);
	of_log(@"[%@] %@: %@", channel, user, msg);
}

-	  (void)connection: (IRCConnection*)conn
-	  (void)connection: (IRCConnection*)connection
  didReceivePrivateMessage: (OFString*)msg
		  fromUser: (IRCUser*)user
{
	of_log(@"(%@): %@", user, msg);
}
@end