Commit Graph

92 Commits

Author SHA1 Message Date
Alexey Sokolov 69b031c43c Workaround test failure on cygwin64 2015-10-24 11:56:23 +01:00
Alexey Sokolov db550a3aa0 Add one more small test. 2015-10-20 08:12:34 +01:00
Alexey Sokolov a35a5d3bc8 Test: add typedef for a widely used type 2015-10-20 08:02:46 +01:00
Alexey Sokolov 38288a17e9 Test: slightly more compact output 2015-10-20 08:00:36 +01:00
Alexey Sokolov 933aa6db0c Add some more tests and fix a bug which sometimes blocked login of users.
This bug wasn't released yet.
cc @jpnurmi
2015-10-18 23:22:32 +01:00
Alexey Sokolov eb450ee885 Test: extract some building blocks to make future tests easier 2015-10-18 22:23:42 +01:00
Alexey Sokolov 1caf6541a0 Test: workaround some Qt's annoyances, and add one more small test. 2015-10-18 21:39:59 +01:00
Alexey Sokolov 90ae78533f Rewrite integration test.
Pexpect was failing too often, even when starting a new process.
Now the test is using Qt and C++.

Fix #772
2015-10-17 15:27:18 +01:00
Alexey Sokolov 8f598273f9 Test: launch ZNC on a config created during --makeconf and connect. 2015-10-03 21:38:18 +01:00
J-P Nurmi d66cb36cc3 Unit test CClient message handlers 2015-09-21 23:26:50 +02:00
J-P Nurmi 3cb2834cc5 Fix STATUSMSG buffering 2015-09-21 15:41:20 +02:00
J-P Nurmi 565d04a8ef Resolve 'make test' warnings
Fix our own, and hide csocket, gtest & gmock related.
2015-09-21 15:41:20 +02:00
J-P Nurmi ecb9b21055 Move message tags related code from CUtils to CMessage 2015-09-20 23:22:03 +02:00
J-P Nurmi 7d10ad2625 CBuffer: add CMessage-based API 2015-09-20 23:22:03 +02:00
J-P Nurmi cbd860c2a9 Add CMessage::Equals()
Compares sender, command, and parameters. Not timestamp nor tags.
2015-09-20 23:22:02 +02:00
J-P Nurmi c223d3a500 Unit test CClient::PutClient(CMessage) 2015-09-20 23:22:02 +02:00
J-P Nurmi 467d48cb45 Share the unit test classes 2015-09-20 23:22:02 +02:00
J-P Nurmi cb84ecac9c Port CIRCSock::ParseISupport() to use CMessage 2015-09-20 23:22:01 +02:00
J-P Nurmi 683379df7d CUtils::ParseServerTime(): fix handling of invalid timestamps 2015-09-18 01:16:01 +02:00
J-P Nurmi f1973fe81b MessageTest: prefer EXPECT_THAT and ContainerEq 2015-09-18 01:02:12 +02:00
J-P Nurmi 57fb58bf71 Fix CModeMessage::GetModes()
Thanks to KindOne for finding the bug. CModeMessage::GetModes()
must trim the colon that CMessage::GetParams() may include.
2015-09-17 13:26:24 +02:00
J-P Nurmi 08ad9c40cc QueryTest: fix signed vs. unsigned comparison warnings 2015-09-13 02:15:10 +02:00
J-P Nurmi 75ee9cec62 Add QueryTest 2015-09-10 01:44:06 +02:00
J-P Nurmi 1a3e9ecb86 Resolve #1045: Make CMessage retain the colon
If the colon was there when parsed, stick it back even if it would be
technically unnecessary.
2015-09-10 00:21:04 +02:00
J-P Nurmi ba76e041b9 Add OnNumericMessage() module hook (close #1069) 2015-09-07 16:41:15 +02:00
J-P Nurmi fc981fa44c MessageTest: test CTargetMessage in one place 2015-09-07 00:00:28 +02:00
J-P Nurmi f71a0a213e Add IRCSockTest 2015-09-07 00:00:28 +02:00
J-P Nurmi 5880bb4180 Add CMessage::GetType() 2015-09-07 00:00:25 +02:00
J-P Nurmi 2bee156316 CString CMessage::GetParams(): keep the colon, even at the beginning 2015-09-07 00:00:25 +02:00
J-P Nurmi 58fc0e91d7 Add CCTCPMessage::IsReply() 2015-09-07 00:00:24 +02:00
J-P Nurmi ec952024d7 Add CModeMessage 2015-09-07 00:00:24 +02:00
J-P Nurmi fa894a86b0 Add CNumericMessage 2015-09-07 00:00:24 +02:00
J-P Nurmi 50ed9adf8a Fix CMessage::GetParams() crash - thanks kerio 2015-09-05 23:45:26 +02:00
Alexey Sokolov 78ba391d70 Merge branch 'master' of github.com:znc/znc 2015-09-04 20:33:12 +01:00
Alexey Sokolov 1cc4626226 Add a test for --makeconf 2015-09-04 20:32:13 +01:00
J-P Nurmi a79acacfad Add missing CModules::OnCTCPReplyMessage() 2015-09-02 00:51:05 +02:00
J-P Nurmi 491fb50045 Cleanup MessageTest
Use CMessage::Parse(), which wasn't public when the tests were
originally written, to avoid the ugly static_casts.
2015-09-01 23:37:22 +02:00
J-P Nurmi 94055c1c82 Add ModulesTest
Just a simple unit test for CModules that checks that the legacy hooks
get called and any modifications flow back to the original CMessage
object as appropriate.
2015-08-31 00:24:30 +02:00
J-P Nurmi 55385a5d58 Add CTargetMessage: a base class for "targeted" priv/chan messages
This will be useful for implementing the upcoming OnUserXxxMessage()
module hooks, that are allowed to modify the message target.
2015-08-30 15:50:12 +02:00
J-P Nurmi 320abef756 Merge CChanMessage & CPrivMessage to... CTextMessage
This naming is a bit hairy. I chose CTextMessage because this type of
message carries a text argument. Alternatively, it could be also called
CPrivateMessage, because the IRC protocol calls it PRIVMSG. On the other
hand, ZNC module hooks use the "Priv" naming convention for private
messages. It would look a bit weird to have OnChanMsg(CPrivMessage)...

More details and reasoning of the merge in the previous commit message.
2015-08-30 15:50:12 +02:00
J-P Nurmi 3976651c35 Merge CChan+PrivAction, CChan+PrivCTCP, CChan+PrivNotice
OnUserAction(), OnUserCTCP(), and OnUserNotice() don't separate private
private and channel messages. A module could even redirect a message by
modifying its target, so technically, if they were two distinct types,
the type of a message could change on the way.

The original reason for the separation was that at some point during
CMessage development, GetChan() didn't exist in CPrivXxx, but only in
CChanXxx message types. To achieve cleaner implementation, the getter
was later promoted to CMessage and made return nullptr for non-channel
specific messages. From this point of view, the separation is also no
longer necessary since the CPrivXxx and CChanXxx types are API-wise
identical with each other.
2015-08-30 15:50:12 +02:00
J-P Nurmi 0ecc0d464f Make params optiona for the CMessage(CNick, CString, ...) ctor
Also fixes the build for Clang <= 3.4, broken by 9a7df7c.
2015-08-27 13:21:45 +02:00
J-P Nurmi 37cd61a667 Fix CMessage to prefix also empty last params with a colon 2015-08-27 12:33:47 +02:00
J-P Nurmi 9a7df7cbbe MessageTest: test also CMessage(CNick, CString, ...) 2015-08-27 12:31:57 +02:00
J-P Nurmi e1ae565e6f Fix GetText() for CTCP [ACTION]
Just like the recent problem with smileys; TrimLeft() is not the same
than TrimPrefix(), and TrimRight() is not the same than TrimSuffix().
2015-08-23 00:48:35 +02:00
J-P Nurmi 2ad2ee5620 Bring back the smileys - part II 2015-08-22 11:54:33 +02:00
J-P Nurmi b8088a5b02 Fix CMessage::ToString() to ':' -prefix the last param when appropriate
Close #1037
2015-08-21 22:08:16 +02:00
J-P Nurmi ff181a4a85 Add specialized types and hooks for the most common msgs
PRIVMSG, NOTICE, JOIN, PART, QUIT, NICK, KICK, TOPIC
2015-08-15 12:27:06 +02:00
J-P Nurmi a06bf1c985 Introduce a Message type (#506) 2015-08-15 12:26:16 +02:00
J-P Nurmi 51caa5c4cf Add CUtils::ParseServerTime() 2015-08-15 12:26:16 +02:00