~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/test/siptest.cpp

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
3
3
 *  Author: Emmanuel Milou <emmanuel.milou@savoirfairelinux.com>
4
4
 *
5
5
 *  This program is free software; you can redistribute it and/or modify
28
28
 *  as that of the covered work.
29
29
 */
30
30
 
31
 
#include <stdlib.h>
32
 
#include <stdio.h>
 
31
#include <unistd.h>
 
32
#include <cstdlib>
 
33
#include <cstdio>
33
34
#include <iostream>
34
35
#include <fstream>
35
36
 
366
367
    CPPUNIT_ASSERT(foo == "17771234567");
367
368
}
368
369
 
 
370
void SIPTest::testParseDisplayName()
 
371
{
 
372
    // 1st element is input, 2nd is expected output
 
373
    const char *test_set[][2] = {
 
374
    {"\nFrom: \"A. G. Bell\" <sip:agb@bell-telephone.com> ;tag=a48s", "A. G. Bell"},
 
375
    {"\nFrom: \"A. G. Bell2\" <sip:agb@bell-telephone.com> ;tag=a48s\r\nOtherLine: \"bla\"\r\n", "A. G. Bell2"},
 
376
    {"\nf: Anonymous <sip:c8oqz84zk7z@privacy.org>;tag=hyh8", "Anonymous"},
 
377
    {"\nFrom: \"Alejandro Perez\" <sip:1111@10.0.0.1>;tag=3a7516a63bdbo0", "Alejandro Perez"},
 
378
    {"\nFrom: \"Malformed <sip:1111@10.0.0.1>;tag=3a6a63bdbo0", ""},
 
379
    {"\nTo: <sip:1955@10.0.0.1>;tag=as6fbade41", ""},
 
380
    {"\nFrom: \"1000\" <sip:1000@sip.example.es>;tag=as775338f3", "1000"},
 
381
    {"\nFrom: 1111_9532323 <sip:1111_9532323@sip.example.es>;tag=caa3a61", "1111_9532323"},
 
382
    {"\nFrom: \"4444_953111111\" <sip:4444_111111@sip.example.es>;tag=2b00632co0", "4444_953111111"},
 
383
    {"\nFrom: <sip:6926666@4.4.4.4>;tag=4421-D9700", ""},
 
384
    {"\nFrom: <sip:pinger@sipwise.local>;tag=01f516a4", ""},
 
385
    {"\nFrom: sip:pinger@sipwise.local;tag=01f516a4", ""},
 
386
    {"\nFrom: sip:+1212555@server.example.com;tag=887s", ""}};
 
387
 
 
388
    for (const auto &t : test_set) {
 
389
        const std::string str(sip_utils::parseDisplayName(t[0]));
 
390
        CPPUNIT_ASSERT(str == t[1]);
 
391
    }
 
392
}
369
393
 
370
394
void SIPTest::testIncomingIpCallSdp()
371
395
{