Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
4732e417
Commit
4732e417
authored
Sep 14, 2017
by
Ronan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Variant): add getValueAsGeneric impl
parent
1d02af06
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
1 deletion
+53
-1
src/variant/variant.cpp
src/variant/variant.cpp
+6
-1
tester/CMakeLists.txt
tester/CMakeLists.txt
+1
-0
tester/liblinphone_tester.h
tester/liblinphone_tester.h
+1
-0
tester/property-container-tester.cpp
tester/property-container-tester.cpp
+44
-0
tester/tester.c
tester/tester.c
+1
-0
No files found.
src/variant/variant.cpp
View file @
4732e417
...
...
@@ -368,7 +368,12 @@ static inline float getValueAsString (const VariantPrivate &p, bool *soFarSoGood
}
static
inline
void
*
getValueAsGeneric
(
const
VariantPrivate
&
p
,
bool
*
soFarSoGood
)
{
// TODO.
if
(
p
.
type
==
Variant
::
Generic
)
{
*
soFarSoGood
=
true
;
return
p
.
value
.
g
;
}
*
soFarSoGood
=
false
;
return
nullptr
;
}
...
...
tester/CMakeLists.txt
View file @
4732e417
...
...
@@ -199,6 +199,7 @@ set(SOURCE_FILES_CXX
clonable-object-tester.cpp
cpim-tester.cpp
events-db-tester.cpp
property-container-tester.cpp
)
set
(
SOURCE_FILES_OBJC
)
...
...
tester/liblinphone_tester.h
View file @
4732e417
...
...
@@ -56,6 +56,7 @@ extern test_suite_t offeranswer_test_suite;
extern
test_suite_t
player_test_suite
;
extern
test_suite_t
presence_server_test_suite
;
extern
test_suite_t
presence_test_suite
;
extern
test_suite_t
property_container_test_suite
;
extern
test_suite_t
proxy_config_test_suite
;
extern
test_suite_t
quality_reporting_test_suite
;
extern
test_suite_t
register_test_suite
;
...
...
tester/property-container-tester.cpp
0 → 100644
View file @
4732e417
/*
* property-container-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/property-container.h"
#include "liblinphone_tester.h"
// =============================================================================
using
namespace
std
;
using
namespace
LinphonePrivate
;
// -----------------------------------------------------------------------------
static
void
set_integer_property
()
{
PropertyContainer
properties
;
properties
.
setProperty
(
"integer"
,
42
);
BC_ASSERT_EQUAL
(
properties
.
getProperty
(
"integer"
).
getValue
<
int
>
(),
42
,
int
,
"%d"
);
}
test_t
property_container_tests
[]
=
{
TEST_NO_TAG
(
"Set int property"
,
set_integer_property
)
};
test_suite_t
property_container_test_suite
=
{
"PropertyContainer"
,
NULL
,
NULL
,
liblinphone_tester_before_each
,
liblinphone_tester_after_each
,
sizeof
(
property_container_tests
)
/
sizeof
(
property_container_tests
[
0
]),
property_container_tests
};
tester/tester.c
View file @
4732e417
...
...
@@ -573,6 +573,7 @@ void liblinphone_tester_add_suites() {
bc_tester_add_suite
(
&
cpim_test_suite
);
bc_tester_add_suite
(
&
clonable_object_test_suite
);
bc_tester_add_suite
(
&
events_db_test_suite
);
bc_tester_add_suite
(
&
property_container_test_suite
);
#if defined(VIDEO_ENABLED) && defined(HAVE_GTK)
bc_tester_add_suite
(
&
video_test_suite
);
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment