Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
0ff8745a
Commit
0ff8745a
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
Add pertinent test that fails
parent
cbca941c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/README
+1
-0
1 addition, 0 deletions
test/README
test/numbercleanerTest.cpp
+8
-0
8 additions, 0 deletions
test/numbercleanerTest.cpp
test/numbercleanerTest.h
+3
-0
3 additions, 0 deletions
test/numbercleanerTest.h
with
12 additions
and
0 deletions
test/README
0 → 100644
+
1
−
0
View file @
0ff8745a
The daemon has to be recompiled before compiling the unitary tests.
This diff is collapsed.
Click to expand it.
test/numbercleanerTest.cpp
+
8
−
0
View file @
0ff8745a
...
@@ -32,9 +32,11 @@
...
@@ -32,9 +32,11 @@
#define NUMBER_TEST_7 "ext 136"
#define NUMBER_TEST_7 "ext 136"
#define NUMBER_TEST_8 "514 333 4444 ext. 136"
#define NUMBER_TEST_8 "514 333 4444 ext. 136"
#define NUMBER_TEST_9 "514 333 4444 ext 136"
#define NUMBER_TEST_9 "514 333 4444 ext 136"
#define NUMBER_TEST_10 "136"
#define VALID_NUMBER "5143334444"
#define VALID_NUMBER "5143334444"
#define VALID_PREPENDED_NUMBER "95143334444"
#define VALID_PREPENDED_NUMBER "95143334444"
#define VALID_EXTENSION "136"
using
std
::
cout
;
using
std
::
cout
;
using
std
::
endl
;
using
std
::
endl
;
...
@@ -97,6 +99,12 @@ void NumberCleanerTest::test_format_10 (void) {
...
@@ -97,6 +99,12 @@ void NumberCleanerTest::test_format_10 (void) {
CPPUNIT_ASSERT
(
cleaner
->
clean
(
NUMBER_TEST_1
)
==
VALID_PREPENDED_NUMBER
);
CPPUNIT_ASSERT
(
cleaner
->
clean
(
NUMBER_TEST_1
)
==
VALID_PREPENDED_NUMBER
);
}
}
void
NumberCleanerTest
::
test_format_11
(
void
)
{
cleaner
->
set_phone_number_prefix
(
"9"
);
CPPUNIT_ASSERT
(
cleaner
->
get_phone_number_prefix
()
==
"9"
);
CPPUNIT_ASSERT
(
cleaner
->
clean
(
NUMBER_TEST_10
)
==
VALID_EXTENSION
);
}
void
NumberCleanerTest
::
tearDown
(){
void
NumberCleanerTest
::
tearDown
(){
// Delete the cleaner object
// Delete the cleaner object
delete
cleaner
;
cleaner
=
0
;
delete
cleaner
;
cleaner
=
0
;
...
...
This diff is collapsed.
Click to expand it.
test/numbercleanerTest.h
+
3
−
0
View file @
0ff8745a
...
@@ -52,6 +52,7 @@ class NumberCleanerTest : public CppUnit::TestCase {
...
@@ -52,6 +52,7 @@ class NumberCleanerTest : public CppUnit::TestCase {
CPPUNIT_TEST
(
test_format_8
);
CPPUNIT_TEST
(
test_format_8
);
CPPUNIT_TEST
(
test_format_9
);
CPPUNIT_TEST
(
test_format_9
);
CPPUNIT_TEST
(
test_format_10
);
CPPUNIT_TEST
(
test_format_10
);
CPPUNIT_TEST
(
test_format_11
);
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
public:
public:
...
@@ -83,6 +84,8 @@ class NumberCleanerTest : public CppUnit::TestCase {
...
@@ -83,6 +84,8 @@ class NumberCleanerTest : public CppUnit::TestCase {
void
test_format_10
();
void
test_format_10
();
void
test_format_11
();
/*
/*
* Code factoring - Common resources can be released here.
* Code factoring - Common resources can be released here.
* This method is called by unitcpp after each test
* This method is called by unitcpp after each test
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment