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

« back to all changes in this revision

Viewing changes to src/tests/jid/jid_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:
18
18
  if( j.bare() != "abc@server.dom" || j.username() != "abc" || j.server() != "server.dom" )
19
19
  {
20
20
    ++fail;
21
 
    printf( "test '%s' failed\n", name.c_str() );
 
21
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
22
22
  }
23
23
 
24
24
  // -------
28
28
      || j.resource() != "res" )
29
29
  {
30
30
    ++fail;
31
 
    printf( "test '%s' failed\n", name.c_str() );
 
31
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
32
32
  }
33
33
 
34
34
  // -------
37
37
  if( j.full() != "server.dom/res" || j.server() != "server.dom" || j.resource() != "res" )
38
38
  {
39
39
    ++fail;
40
 
    printf( "test '%s' failed\n", name.c_str() );
 
40
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
41
41
  }
42
42
 
43
43
  // -------
46
46
  if( j.full() != "server.dom" || j.server() != "server.dom" )
47
47
  {
48
48
    ++fail;
49
 
    printf( "test '%s' failed\n", name.c_str() );
 
49
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
50
50
  }
51
51
 
52
52
  // -------
55
55
  if( j.bare() != "abc@server.dom" )
56
56
  {
57
57
    ++fail;
58
 
    printf( "test '%s' failed\n", name.c_str() );
 
58
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
59
59
  }
60
60
 
61
61
  // -------
64
64
  if( j.bare() != "abc@server.dom" )
65
65
  {
66
66
    ++fail;
67
 
    printf( "test '%s' failed\n", name.c_str() );
 
67
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
68
68
  }
69
69
 
70
70
  // -------
73
73
  if( j.resource() != "rEsOurCe" )
74
74
  {
75
75
    ++fail;
76
 
    printf( "test '%s' failed\n", name.c_str() );
 
76
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
77
77
  }
78
78
 
79
79
  // -------
82
82
  if( j.username() != "abc" )
83
83
  {
84
84
    ++fail;
85
 
    printf( "test '%s' failed\n", name.c_str() );
 
85
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
86
86
  }
87
87
 
88
88
  // -------
91
91
  if( j.server() != "server.dom" )
92
92
  {
93
93
    ++fail;
94
 
    printf( "test '%s' failed\n", name.c_str() );
 
94
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
95
95
  }
96
96
 
97
97
  // -------
101
101
  if( j.bareJID() != t1.bareJID() )
102
102
  {
103
103
    ++fail;
104
 
    printf( "test '%s' failed\n", name.c_str() );
 
104
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
105
105
  }
106
106
 
107
107
  // -------
116
116
        || !j.full().empty() )
117
117
  {
118
118
    ++fail;
119
 
    printf( "test '%s' failed\n", name.c_str() );
 
119
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
120
120
  }
121
121
 
122
122
  // -------
125
125
  if( !jid1 )
126
126
  {
127
127
    ++fail;
128
 
    printf( "test '%s' failed\n", name.c_str() );
 
128
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
129
129
  }
130
130
 
131
131
  // -------
134
134
  if( jid2 )
135
135
  {
136
136
    ++fail;
137
 
    printf( "test '%s' failed\n", name.c_str() );
 
137
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
138
138
  }
139
139
 
140
140
  // -------
143
143
  if( e != "1\\202\\223\\264\\275\\2f6\\3a7\\3c8\\3e9\\4010\\5c" )
144
144
  {
145
145
    ++fail;
146
 
    printf( "test '%s' failed\n", name.c_str() );
 
146
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
147
147
  }
148
148
 
149
149
  // -------
152
152
  if( f != "1 2\"3&4'5/6:7<8>9@10\\" )
153
153
  {
154
154
    ++fail;
155
 
    printf( "test '%s' failed\n", name.c_str() );
 
155
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
156
156
  }
157
157
 
158
158
 
171
171
  }
172
172
  else
173
173
  {
174
 
    printf( "JID: %d test(s) failed\n", fail );
 
174
    fprintf( stderr, "JID: %d test(s) failed\n", fail );
175
175
    return 1;
176
176
  }
177
177