Commit 0ff8745a authored by Emmanuel Milou's avatar Emmanuel Milou

Add pertinent test that fails

parent cbca941c
The daemon has to be recompiled before compiling the unitary tests.
......@@ -32,9 +32,11 @@
#define NUMBER_TEST_7 "ext 136"
#define NUMBER_TEST_8 "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_PREPENDED_NUMBER "95143334444"
#define VALID_EXTENSION "136"
using std::cout;
using std::endl;
......@@ -97,6 +99,12 @@ void NumberCleanerTest::test_format_10 (void) {
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(){
// Delete the cleaner object
delete cleaner; cleaner=0;
......
......@@ -52,6 +52,7 @@ class NumberCleanerTest : public CppUnit::TestCase {
CPPUNIT_TEST (test_format_8);
CPPUNIT_TEST (test_format_9);
CPPUNIT_TEST (test_format_10);
CPPUNIT_TEST (test_format_11);
CPPUNIT_TEST_SUITE_END ();
public:
......@@ -83,6 +84,8 @@ class NumberCleanerTest : public CppUnit::TestCase {
void test_format_10 ();
void test_format_11 ();
/*
* Code factoring - Common resources can be released here.
* This method is called by unitcpp after each test
......
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