Protect some parts of code from clang-format

This commit is contained in:
Alexey Sokolov
2015-12-07 00:12:20 +00:00
parent 7869de1e0f
commit 02f8749a8b
4 changed files with 10 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ TEST_F(BufferTest, AddLine) {
}
TEST_F(BufferTest, UpdateLine) {
// clang-format off
CBuffer buffer(50);
VCString lines = {
@@ -129,4 +130,5 @@ TEST_F(BufferTest, UpdateLine) {
EXPECT_EQ(17u, buffer.UpdateExactLine(CMessage(":irc.server.com 005 nick FOO=bar :are supported by this server")));
EXPECT_EQ(":irc.server.com 005 nick FOO=bar :are supported by this server", buffer.GetBufLine(16).GetFormat());
// clang-format on
}

View File

@@ -42,6 +42,7 @@ protected:
};
TEST_F(ClientTest, Pass) {
// clang-format off
testPass("p@ss#w0rd", "", "", "", "p@ss#w0rd");
testPass("user:p@ss#w0rd", "user", "", "", "p@ss#w0rd");
testPass("user/net-work:p@ss#w0rd", "user", "", "net-work", "p@ss#w0rd");
@@ -52,9 +53,11 @@ TEST_F(ClientTest, Pass) {
testPass("user@znc.in/net-work:p@ss#w0rd", "user@znc.in", "", "net-work", "p@ss#w0rd");
testPass("user@znc.in@identifier:p@ss#w0rd", "user@znc.in", "identifier", "", "p@ss#w0rd");
testPass("user@znc.in@identifier/net-work:p@ss#w0rd", "user@znc.in", "identifier", "net-work", "p@ss#w0rd");
// clang-format on
}
TEST_F(ClientTest, User) {
// clang-format off
testUser("user/net-work", "user", "", "net-work");
testUser("user@identifier", "user", "identifier", "");
testUser("user@identifier/net-work", "user", "identifier", "net-work");
@@ -62,6 +65,7 @@ TEST_F(ClientTest, User) {
testUser("user@znc.in/net-work", "user@znc.in", "", "net-work");
testUser("user@znc.in@identifier", "user@znc.in", "identifier", "");
testUser("user@znc.in@identifier/net-work", "user@znc.in", "identifier", "net-work");
// clang-format on
}
TEST_F(ClientTest, AccountNotify) {

View File

@@ -153,6 +153,7 @@ private:
};
void WriteConfig(QString path) {
// clang-format off
Process p("./znc", QStringList() << "--debug" << "--datadir" << path << "--makeconf", true);
p.ReadUntil("Listen on port");Z; p.Write("12345");
p.ReadUntil("Listen using SSL");Z; p.Write();
@@ -174,6 +175,7 @@ void WriteConfig(QString path) {
p.ReadUntil("channels");Z; p.Write();
p.ReadUntil("Launch ZNC now?");Z; p.Write("no");
p.ShouldFinishItself();
// clang-format on
}
TEST(Config, AlreadyExists) {

View File

@@ -49,12 +49,14 @@ protected:
};
TEST_F(EscapeTest, Test) {
// clang-format off
// input url html sql msgtag
testString("abcdefg","abcdefg", "abcdefg", "abcdefg", "abcdefg");
testString("\n\t\r", "%0A%09%0D", "\n\t\r", "\\n\\t\\r", "\\n\t\\r");
testString("'\"", "%27%22", "'&quot;", "\\'\\\"", "'\"");
testString("&<>", "%26%3C%3E", "&amp;&lt;&gt;", "&<>", "&<>");
testString(" ;", "+%3B", " ;", " ;", "\\s\\:");
// clang-format on
}
TEST(StringTest, Bool) {