From b55bdc9c0bb68236aa2de0a8eaec9f4c80cc2769 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Wed, 5 Sep 2018 23:54:48 +0200 Subject: Code style and clarity. --- tests/parser/streamContentHandlerTest.cpp | 59 ++++++++++++++++++------------- 1 file changed, 34 insertions(+), 25 deletions(-) (limited to 'tests/parser/streamContentHandlerTest.cpp') diff --git a/tests/parser/streamContentHandlerTest.cpp b/tests/parser/streamContentHandlerTest.cpp index 55680c93..399118e7 100644 --- a/tests/parser/streamContentHandlerTest.cpp +++ b/tests/parser/streamContentHandlerTest.cpp @@ -1,6 +1,6 @@ // // VMime library (http://www.vmime.org) -// Copyright (C) 2002-2013 Vincent Richard +// Copyright (C) 2002 Vincent Richard // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -41,15 +41,15 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) VMIME_TEST_LIST_END - void testIsEmpty() - { + void testIsEmpty() { + vmime::streamContentHandler cth; VASSERT_TRUE("empty", cth.isEmpty()); } - void testGetLength() - { + void testGetLength() { + vmime::string data("Test Data"); vmime::shared_ptr stream = vmime::make_shared (data); @@ -60,8 +60,8 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) VASSERT_EQ("length", 9, cth.getLength()); } - void testIsEncoded() - { + void testIsEncoded() { + vmime::string data("Test Data"); vmime::shared_ptr stream = vmime::make_shared (data); @@ -82,8 +82,8 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) VASSERT_EQ("encoding", "base64", cth2.getEncoding().generate()); } - void testGetLength_Encoded() - { + void testGetLength_Encoded() { + vmime::string data("foo=12=34=56bar"); vmime::shared_ptr stream = vmime::make_shared (data); @@ -94,8 +94,8 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) VASSERT_EQ("length", 15, cth.getLength()); } - void testExtract() - { + void testExtract() { + vmime::string data("Test Data"); vmime::shared_ptr stream = vmime::make_shared (data); @@ -110,10 +110,12 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) VASSERT_EQ("extract", "Test Data", oss.str()); } - void testExtract_Encoded() - { - vmime::string data - ("QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODk="); + void testExtract_Encoded() { + + vmime::string data( + "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODk=" + ); + vmime::shared_ptr stream = vmime::make_shared (data); @@ -125,14 +127,18 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) cth.extract(osa); // Data should be decoded from B64 - VASSERT_EQ("extract", - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", oss.str()); + VASSERT_EQ( + "extract", + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", + oss.str() + ); } void testExtractRaw_Encoded() { - vmime::string data - ("QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODk="); + vmime::string data( + "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODk=" + ); vmime::shared_ptr stream = vmime::make_shared (data); @@ -144,12 +150,15 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) cth.extractRaw(osa); // Data should not be decoded - VASSERT_EQ("extractRaw", - "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODk=", oss.str()); + VASSERT_EQ( + "extractRaw", + "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODk=", + oss.str() + ); } - void testGenerate() - { + void testGenerate() { + vmime::string data("foo\x12\x34\x56 bar"); vmime::shared_ptr stream = vmime::make_shared (data); @@ -165,8 +174,8 @@ VMIME_TEST_SUITE_BEGIN(streamContentHandlerTest) VASSERT_EQ("generate", "Zm9vEjRWIGJhcg==", oss.str()); } - void testGenerate_Encoded() - { + void testGenerate_Encoded() { + vmime::string data("foo=12=34=56bar"); vmime::shared_ptr stream = vmime::make_shared (data); -- cgit v1.2.3