~ubuntu-branches/ubuntu/vivid/gloox/vivid-proposed

« back to all changes in this revision

Viewing changes to src/tests/adhoccommandnote/adhoccommandnote_test.cpp

  • Committer: Package Import Robot
  • Author(s): Vincent Cheng
  • Date: 2014-03-16 17:34:43 UTC
  • mfrom: (12.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: package-import@ubuntu.com-20140316173443-4s177dovzaz5dm8o
Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
        || t->xml() != "<note type='info'>content</note>" )
27
27
    {
28
28
      ++fail;
29
 
      printf( "test '%s' failed\n", name.c_str() );
 
29
      fprintf( stderr, "test '%s' failed\n", name.c_str() );
30
30
    }
31
31
    delete t;
32
32
    t = 0;
41
41
        || t->xml() != "<note type='warn'>content</note>" )
42
42
    {
43
43
      ++fail;
44
 
      printf( "test '%s' failed\n", name.c_str() );
45
 
    }
46
 
    delete t;
47
 
    t = 0;
48
 
  }
49
 
 
50
 
  // -------
51
 
  {
52
 
    name = "error note";
53
 
    Adhoc::Command::Note n( Adhoc::Command::Note::Error, "content" );
54
 
    t = n.tag();
55
 
    if( n.severity() != Adhoc::Command::Note::Error || n.content() != "content"
56
 
        || t->xml() != "<note type='error'>content</note>" )
57
 
    {
58
 
      ++fail;
59
 
      printf( "test '%s' failed\n", name.c_str() );
60
 
    }
61
 
    delete t;
62
 
    t = 0;
63
 
  }
64
 
 
65
 
  // -------
66
 
  {
67
 
    name = "error note";
68
 
    Adhoc::Command::Note n( Adhoc::Command::Note::Error, "content" );
69
 
    t = n.tag();
70
 
    if( n.severity() != Adhoc::Command::Note::Error || n.content() != "content"
71
 
        || t->xml() != "<note type='error'>content</note>" )
72
 
    {
73
 
      ++fail;
74
 
      printf( "test '%s' failed\n", name.c_str() );
 
44
      fprintf( stderr, "test '%s' failed\n", name.c_str() );
 
45
    }
 
46
    delete t;
 
47
    t = 0;
 
48
  }
 
49
 
 
50
  // -------
 
51
  {
 
52
    name = "error note";
 
53
    Adhoc::Command::Note n( Adhoc::Command::Note::Error, "content" );
 
54
    t = n.tag();
 
55
    if( n.severity() != Adhoc::Command::Note::Error || n.content() != "content"
 
56
        || t->xml() != "<note type='error'>content</note>" )
 
57
    {
 
58
      ++fail;
 
59
      fprintf( stderr, "test '%s' failed\n", name.c_str() );
 
60
    }
 
61
    delete t;
 
62
    t = 0;
 
63
  }
 
64
 
 
65
  // -------
 
66
  {
 
67
    name = "error note";
 
68
    Adhoc::Command::Note n( Adhoc::Command::Note::Error, "content" );
 
69
    t = n.tag();
 
70
    if( n.severity() != Adhoc::Command::Note::Error || n.content() != "content"
 
71
        || t->xml() != "<note type='error'>content</note>" )
 
72
    {
 
73
      ++fail;
 
74
      fprintf( stderr, "test '%s' failed\n", name.c_str() );
75
75
    }
76
76
    delete t;
77
77
    t = 0;
88
88
    if( *t != *b )
89
89
    {
90
90
      ++fail;
91
 
      printf( "test '%s' failed\n", name.c_str() );
 
91
      fprintf( stderr, "test '%s' failed\n", name.c_str() );
92
92
    }
93
93
    delete t;
94
94
    t = 0;
106
106
    if( *t != *b )
107
107
    {
108
108
      ++fail;
109
 
      printf( "test '%s' failed\n", name.c_str() );
 
109
      fprintf( stderr, "test '%s' failed\n", name.c_str() );
110
110
    }
111
111
    delete t;
112
112
    t = 0;
123
123
  }
124
124
  else
125
125
  {
126
 
    printf( "Adhoc::Command::Note: %d test(s) failed\n", fail );
 
126
    fprintf( stderr, "Adhoc::Command::Note: %d test(s) failed\n", fail );
127
127
    return 1;
128
128
  }
129
129