Commit 3a88c110 authored by Ronan's avatar Ronan

feat(tester): add new tester on Object

parent 0595cd1e
......@@ -203,6 +203,7 @@ set(SOURCE_FILES_CXX
cpim-tester.cpp
main-db-tester.cpp
multipart-tester.cpp
object-tester.cpp
property-container-tester.cpp
)
......
......@@ -49,14 +49,15 @@ extern test_suite_t content_manager_test_suite;
extern test_suite_t cpim_test_suite;
extern test_suite_t dtmf_test_suite;
extern test_suite_t event_test_suite;
extern test_suite_t main_db_test_suite;
extern test_suite_t flexisip_test_suite;
extern test_suite_t group_chat_test_suite;
extern test_suite_t log_collection_test_suite;
extern test_suite_t main_db_test_suite;
extern test_suite_t message_test_suite;
extern test_suite_t multi_call_test_suite;
extern test_suite_t multicast_call_test_suite;
extern test_suite_t multipart_test_suite;
extern test_suite_t object_test_suite;
extern test_suite_t offeranswer_test_suite;
extern test_suite_t player_test_suite;
extern test_suite_t presence_server_test_suite;
......
/*
* object-tester.cpp
* Copyright (C) 2017 Belledonne Communications SARL
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "object/object-p.h"
#include "object/object-p.h"
#include "liblinphone_tester.h"
#include "tester_utils.h"
// =============================================================================
using namespace std;
using namespace LinphonePrivate;
// -----------------------------------------------------------------------------
class TestObjectPrivate : public ObjectPrivate {
public:
TestObjectPrivate () = default;
TestObjectPrivate (const TestObjectPrivate &) : TestObjectPrivate() {}
};
class TestObject : public Object {
public:
TestObject () : Object(*new TestObjectPrivate) {}
TestObject (const TestObject &src) : Object(*new TestObjectPrivate(*src.getPrivate())) {}
private:
L_DECLARE_PRIVATE(TestObject);
};
// -----------------------------------------------------------------------------
static void check_object_creation () {
TestObject *object = new TestObject();
TestObject *object2 = new TestObject(*object);
delete object;
delete object2;
}
test_t object_tests[] = {
TEST_NO_TAG("Check object creation", check_object_creation)
};
test_suite_t object_test_suite = {
"Object", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each,
sizeof(object_tests) / sizeof(object_tests[0]), object_tests
};
......@@ -615,6 +615,7 @@ void liblinphone_tester_add_suites() {
bc_tester_add_suite(&cpim_test_suite);
bc_tester_add_suite(&multipart_test_suite);
bc_tester_add_suite(&clonable_object_test_suite);
bc_tester_add_suite(&object_test_suite);
bc_tester_add_suite(&main_db_test_suite);
bc_tester_add_suite(&property_container_test_suite);
#if defined(VIDEO_ENABLED) && defined(HAVE_GTK)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment