summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-08-22 21:07:51 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-08-23 08:02:12 (GMT)
commit00284e5f4445a7bbab482196901c5927ea7d5488 (patch)
treef2ca6e0c51632a8aa5a7a884f3b312bacc3a2fb0 /Swiften/Elements/UnitTest
parent54da0a4c0cceae947afbde586a97d1cc60c50ed8 (diff)
downloadswift-00284e5f4445a7bbab482196901c5927ea7d5488.zip
swift-00284e5f4445a7bbab482196901c5927ea7d5488.tar.bz2
FormField element refactoring.
This should make FormField easier to use. Change-Id: Ia5eeedcdb673e2fe5e38fd23d5ab00970178bc44
Diffstat (limited to 'Swiften/Elements/UnitTest')
-rw-r--r--Swiften/Elements/UnitTest/FormTest.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/Swiften/Elements/UnitTest/FormTest.cpp b/Swiften/Elements/UnitTest/FormTest.cpp
index 1134182..3000c22 100644
--- a/Swiften/Elements/UnitTest/FormTest.cpp
+++ b/Swiften/Elements/UnitTest/FormTest.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 Remko Tronçon
+ * Copyright (c) 2010-2013 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
@@ -7,6 +7,7 @@
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <boost/shared_ptr.hpp>
+#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/Form.h>
@@ -23,13 +24,13 @@ class FormTest : public CppUnit::TestFixture {
void testGetFormType() {
Form form;
- form.addField(FixedFormField::create("Foo"));
+ form.addField(boost::make_shared<FormField>(FormField::FixedType, "Foo"));
- FormField::ref field = HiddenFormField::create("jabber:bot");
+ FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
field->setName("FORM_TYPE");
form.addField(field);
- form.addField(FixedFormField::create("Bar"));
+ form.addField(boost::make_shared<FormField>(FormField::FixedType, "Bar"));
CPPUNIT_ASSERT_EQUAL(std::string("jabber:bot"), form.getFormType());
}
@@ -37,7 +38,7 @@ class FormTest : public CppUnit::TestFixture {
void testGetFormType_InvalidFormType() {
Form form;
- FormField::ref field = FixedFormField::create("jabber:bot");
+ FormField::ref field = boost::make_shared<FormField>(FormField::FixedType, "jabber:bot");
field->setName("FORM_TYPE");
form.addField(field);
@@ -47,7 +48,7 @@ class FormTest : public CppUnit::TestFixture {
void testGetFormType_NoFormType() {
Form form;
- form.addField(FixedFormField::create("Foo"));
+ form.addField(boost::make_shared<FormField>(FormField::FixedType, "Foo"));
CPPUNIT_ASSERT_EQUAL(std::string(""), form.getFormType());
}