comparison test/form.cc @ 2016:8cf59505bd0a

tests cleanup
author corvid <corvid@lavabit.com>
date Sat, 14 May 2011 06:45:42 +0000
parents 02ef25700865
children
comparison
equal deleted inserted replaced
2015:025c664fa44f 2016:8cf59505bd0a
30 this->name = strdup (name); 30 this->name = strdup (name);
31 } 31 }
32 32
33 Form::ResourceDecorator::~ResourceDecorator () 33 Form::ResourceDecorator::~ResourceDecorator ()
34 { 34 {
35 delete name; 35 free((char *)name);
36 } 36 }
37 37
38 Form::TextResourceDecorator::TextResourceDecorator (const char *name, 38 Form::TextResourceDecorator::TextResourceDecorator (const char *name,
39 TextResource *resource): 39 TextResource *resource):
40 Form::ResourceDecorator (name) 40 Form::ResourceDecorator (name)
55 55
56 int n = 0; 56 int n = 0;
57 while (values[n]) 57 while (values[n])
58 n++; 58 n++;
59 this->values = new const char*[n + 1]; 59 this->values = new const char*[n + 1];
60 for(int i = 0; i < n; i++) 60 for (int i = 0; i < n; i++)
61 this->values[i] = strdup (values[i]); 61 this->values[i] = strdup (values[i]);
62 this->values[n] = 0; 62 this->values[n] = 0;
63 } 63 }
64 64
65 Form::RadioButtonResourceDecorator::~RadioButtonResourceDecorator () 65 Form::RadioButtonResourceDecorator::~RadioButtonResourceDecorator ()
66 { 66 {
67 for(int i = 0; values[i]; i++) 67 for (int i = 0; values[i]; i++)
68 delete values[i]; 68 free((char *)values[i]);
69 delete[] values; 69 delete[] values;
70 } 70 }
71 71
72 const char *Form::RadioButtonResourceDecorator::getValue () 72 const char *Form::RadioButtonResourceDecorator::getValue ()
73 { 73 {
113 } 113 }
114 114
115 Form::SelectionResourceDecorator::~SelectionResourceDecorator () 115 Form::SelectionResourceDecorator::~SelectionResourceDecorator ()
116 { 116 {
117 for(int i = 0; values[i]; i++) 117 for(int i = 0; values[i]; i++)
118 delete values[i]; 118 free((char *)values[i]);
119 delete[] values; 119 delete[] values;
120 } 120 }
121 121
122 const char *Form::SelectionResourceDecorator::getValue () 122 const char *Form::SelectionResourceDecorator::getValue ()
123 { 123 {
157 this->value = strdup (value); 157 this->value = strdup (value);
158 } 158 }
159 159
160 Form::FormClickedReceiver::~FormClickedReceiver () 160 Form::FormClickedReceiver::~FormClickedReceiver ()
161 { 161 {
162 delete name; 162 free((char *)name);
163 delete[] value; 163 free((char *)value);
164 } 164 }
165 165
166 void Form::FormClickedReceiver::clicked (Resource *resource, 166 void Form::FormClickedReceiver::clicked (Resource *resource,
167 dw::core::EventButton *event) 167 dw::core::EventButton *event)
168 { 168 {