Revision 995

trunk/tests/adstring/tools99_strcase.cpp (revision 995)
1
/**
2
 * Tests for errors in "void adstring::to_lower(void)"
3
 */
4
TEST_F(test_adstring, tools99_strcase_01)
5
{
6
  adstring a = "abc-123";
7
  a.to_upper();
8
  adstring expected = "ABC-123";
9
  if (a == expected)
10
  {
11
    SUCCEED();
12
    return;
13
  }
14
  FAIL();
15
}
16
/**
17
 * Tests for errors in "adstring to_upper(adstring& s)"
18
 */
19
TEST_F(test_adstring, tools99_strcase_02)
20
{
21
  adstring a = "abc-123";
22
  adstring b = to_upper(a);
23
  adstring expected = "ABC-123";
24
  if (b == expected)
25
  {
26
    SUCCEED();
27
    return;
28
  }
29
  FAIL();
30
}
31
/**
32
 * Tests for errors in "void adstring::to_upper(void)"
33
 */
34
TEST_F(test_adstring, tools99_strcase_03)
35
{
36
  adstring a = "ABC-123";
37
  a.to_lower();
38
  adstring expected = "abc-123";
39
  if (a == expected)
40
  {
41
    SUCCEED();
42
    return;
43
  }
44
  FAIL();
45
}
46
/**
47
 * Tests for errors in "adstring to_lower(adstring& s)"
48
 */
49
TEST_F(test_adstring, tools99_strcase_04)
50
{
51
  adstring a = "ABC-123";
52
  adstring b = to_lower(a);
53
  adstring expected = "abc-123";
54
  if (b == expected)
55
  {
56
    SUCCEED();
57
    return;
58
  }
59
  FAIL();
60
}
61
/**
62
 * Tests for errors in "adstring_array to_lower(adstring_array& s)"
63
 */
64
TEST_F(test_adstring, tools99_strcase2_05)
65
{
66
  adstring_array a(1, 3);
67
  a(1) = "ABC-123";
68
  a(2) = "ABC-123";
69
  a(3) = "ABC-123";
70
  adstring_array b = to_lower(a);
71
  adstring expected = "abc-123";
72
  if (b(1) == expected 
73
      && b(2) == expected
74
      && b(3) == expected)
75
  {
76
    SUCCEED();
77
    return;
78
  }
79
  FAIL();
80
}
81
/**
82
 * Tests for errors in "adstring_array to_upper(adstring_array& s)"
83
 */
84
TEST_F(test_adstring, tools99_strcase2_06)
85
{
86
  adstring_array a(1, 3);
87
  a(1) = "abc-123";
88
  a(2) = "abc-123";
89
  a(3) = "abc-123";
90
  adstring_array b = to_upper(a);
91
  adstring expected = "ABC-123";
92
  if (b(1) == expected 
93
      && b(2) == expected
94
      && b(3) == expected)
95
  {
96
    SUCCEED();
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff