2005-10-04 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Drawing / Test / System.Drawing / TestRectangleConverter.cs
1 //
2 // Tests for System.Drawing.RectangleConverter.cs 
3 //
4 // Author:
5 //      Ravindra (rkumar@novell.com)
6 //
7
8 //
9 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System;
32 using System.Collections;
33 using System.ComponentModel;
34 using System.ComponentModel.Design.Serialization;
35 using System.Drawing;
36 using System.Globalization;
37 using System.Security.Permissions;
38 using System.Threading;
39
40 using NUnit.Framework;
41
42 namespace MonoTests.System.Drawing
43 {
44         [TestFixture]
45         [SecurityPermission (SecurityAction.Deny, UnmanagedCode = true)]
46         public class RectangleConverterTest
47         {
48                 Rectangle rect;
49                 Rectangle rectneg;
50                 RectangleConverter rconv;
51                 String rectStrInvariant;
52                 String rectnegStrInvariant;
53
54                 [SetUp]
55                 public void SetUp ()
56                 {
57                         rect = new Rectangle (10, 10, 20, 30);
58                         rectStrInvariant = rect.X + CultureInfo.InvariantCulture.TextInfo.ListSeparator + " " +
59                         rect.Y + CultureInfo.InvariantCulture.TextInfo.ListSeparator + " " +
60                         rect.Width + CultureInfo.InvariantCulture.TextInfo.ListSeparator + " " + 
61                         rect.Height;
62
63                         rectneg = new Rectangle (-10, -10, 20, 30);
64                         rectnegStrInvariant = rectneg.X + CultureInfo.InvariantCulture.TextInfo.ListSeparator + " " 
65                         + rectneg.Y + CultureInfo.InvariantCulture.TextInfo.ListSeparator + " " + 
66                         rectneg.Width + CultureInfo.InvariantCulture.TextInfo.ListSeparator + " " + rectneg.Height;
67
68                         rconv = (RectangleConverter) TypeDescriptor.GetConverter (rect);
69                 }
70
71                 [Test]
72                 public void TestCanConvertFrom ()
73                 {
74                         Assert.IsTrue (rconv.CanConvertFrom (typeof (String)), "CCF#1");
75                         Assert.IsTrue (rconv.CanConvertFrom (null, typeof (String)), "CCF#2");
76                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (Rectangle)), "CCF#3");
77                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (RectangleF)), "CCF#4");
78                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (Point)), "CCF#5");
79                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (PointF)), "CCF#6");
80                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (Size)), "CCF#7");
81                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (SizeF)), "CCF#8");
82                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (Object)), "CCF#9");
83                         Assert.IsFalse (rconv.CanConvertFrom (null, typeof (int)), "CCF#10");
84                         Assert.IsTrue (rconv.CanConvertFrom (null, typeof (InstanceDescriptor)), "CCF#11");
85                 }
86
87                 [Test]
88                 public void TestCanConvertTo ()
89                 {
90                         Assert.IsTrue (rconv.CanConvertTo (typeof (String)), "CCT#1");
91                         Assert.IsTrue (rconv.CanConvertTo (null, typeof (String)), "CCT#2");
92                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (Rectangle)), "CCT#3");
93                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (RectangleF)), "CCT#4");
94                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (Point)), "CCT#5");
95                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (PointF)), "CCT#6");
96                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (Size)), "CCT#7");
97                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (SizeF)), "CCT#8");
98                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (Object)), "CCT#9");
99                         Assert.IsFalse (rconv.CanConvertTo (null, typeof (int)), "CCT#10");
100                 }
101
102                 [Test]
103                 public void TestConvertFrom ()
104                 {
105                         Assert.AreEqual (rect, (Rectangle) rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
106                                                                 "10, 10, 20, 30"), "CF#1");
107                         Assert.AreEqual (rectneg, (Rectangle) rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
108                                                                 "-10, -10, 20, 30"), "CF#2");
109
110                         try {
111                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture, 
112                                                    "10, 10");
113                                 Assert.Fail ("CF#3: must throw ArgumentException");
114                         } catch (Exception e) {
115                                 Assert.IsTrue (e is ArgumentException, "CF#3");
116                         }
117
118                         try {
119                                 rconv.ConvertFrom ("10");
120                                 Assert.Fail ("CF#3a: must throw ArgumentException");
121                         } catch (Exception e) {
122                                 Assert.IsTrue (e is ArgumentException, "CF#3a");
123                         }
124
125                         try {
126                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
127                                                    "1, 1, 1, 1, 1");
128                                 Assert.Fail ("CF#4: must throw ArgumentException");
129                         } catch (Exception e) {
130                                 Assert.IsTrue (e is ArgumentException, "CF#4");
131                         }
132
133                         try {
134                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
135                                                    "*1, 1, 1, 1");
136                                 Assert.Fail ("CF#5: must throw Exception");
137                         } catch (Exception ex) {
138                                 Assert.AreEqual (typeof (Exception), ex.GetType (), "CF#5-2");
139                                 Assert.IsNotNull (ex.InnerException, "CF#5-3");
140                                 Assert.AreEqual (typeof (FormatException), ex.InnerException.GetType (), "CF#5-4");
141                         }
142
143                         try {
144                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
145                                                    new Rectangle (10, 10, 100, 100));
146                                 Assert.Fail ("CF#6: must throw NotSupportedException");
147                         } catch (Exception e) {
148                                 Assert.IsTrue (e is NotSupportedException, "CF#6");
149                         }
150
151                         try {
152                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
153                                                    new RectangleF (10, 10, 100, 100));
154                                 Assert.Fail ("CF#7: must throw NotSupportedException");
155                         } catch (Exception e) {
156                                 Assert.IsTrue (e is NotSupportedException, "CF#7");
157                         }
158
159                         try {
160                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
161                                                    new Point (10, 10));
162                                 Assert.Fail ("CF#8: must throw NotSupportedException");
163                         } catch (Exception e) {
164                                 Assert.IsTrue (e is NotSupportedException, "CF#8");
165                         }
166
167                         try {
168                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
169                                                    new PointF (10, 10));
170                                 Assert.Fail ("CF#9: must throw NotSupportedException");
171                         } catch (Exception e) {
172                                 Assert.IsTrue (e is NotSupportedException, "CF#9");
173                         }
174
175                         try {
176                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
177                                                    new Size (10, 10));
178                                 Assert.Fail ("CF#10: must throw NotSupportedException");
179                         } catch (Exception e) {
180                                 Assert.IsTrue (e is NotSupportedException, "CF#10");
181                         }
182
183                         try {
184                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
185                                                    new SizeF (10, 10));
186                                 Assert.Fail ("CF#11: must throw NotSupportedException");
187                         } catch (Exception e) {
188                                 Assert.IsTrue (e is NotSupportedException, "CF#11");
189                         }
190
191                         try {
192                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture,
193                                                    new Object ());
194                                 Assert.Fail ("CF#12: must throw NotSupportedException");
195                         } catch (Exception e) {
196                                 Assert.IsTrue (e is NotSupportedException, "CF#12");
197                         }
198
199                         try {
200                                 rconv.ConvertFrom (null, CultureInfo.InvariantCulture, 1001);
201                                 Assert.Fail ("CF#13: must throw NotSupportedException");
202                         } catch (Exception e) {
203                                 Assert.IsTrue (e is NotSupportedException, "CF#13");
204                         }
205                 }
206
207                 [Test]
208                 public void TestConvertTo ()
209                 {
210                         Assert.AreEqual (rectStrInvariant, (String) rconv.ConvertTo (null,
211                                 CultureInfo.InvariantCulture, rect, typeof (String)), "CT#1");
212                         Assert.AreEqual (rectnegStrInvariant, (String) rconv.ConvertTo (null,
213                                 CultureInfo.InvariantCulture, rectneg, typeof (String)), "CT#2");
214
215                         try {
216                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture, 
217                                                  rect, typeof (Rectangle));
218                                 Assert.Fail ("CT#3: must throw NotSupportedException");
219                         } catch (Exception e) {
220                                 Assert.IsTrue (e is NotSupportedException, "CT#3");
221                         }
222
223                         try {
224                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture,
225                                                  rect, typeof (RectangleF));
226                                 Assert.Fail ("CT#4: must throw NotSupportedException");
227                         } catch (Exception e) {
228                                 Assert.IsTrue (e is NotSupportedException, "CT#4");
229                         }
230
231                         try {
232                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture,
233                                                  rect, typeof (Size));
234                                 Assert.Fail ("CT#5: must throw NotSupportedException");
235                         } catch (Exception e) {
236                                 Assert.IsTrue (e is NotSupportedException, "CT#5");
237                         }
238
239                         try {
240                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture,
241                                                  rect, typeof (SizeF));
242                                 Assert.Fail ("CT#6: must throw NotSupportedException");
243                         } catch (Exception e) {
244                                 Assert.IsTrue (e is NotSupportedException, "CT#6");
245                         }
246
247                         try {
248                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture,
249                                                  rect, typeof (Point));
250                                 Assert.Fail ("CT#7: must throw NotSupportedException");
251                         } catch (Exception e) {
252                                 Assert.IsTrue (e is NotSupportedException, "CT#7");
253                         }
254
255                         try {
256                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture,
257                                                  rect, typeof (PointF));
258                                 Assert.Fail ("CT#8: must throw NotSupportedException");
259                         } catch (Exception e) {
260                                 Assert.IsTrue (e is NotSupportedException, "CT#8");
261                         }
262
263                         try {
264                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture,
265                                                  rect, typeof (Object));
266                                 Assert.Fail ("CT#9: must throw NotSupportedException");
267                         } catch (Exception e) {
268                                 Assert.IsTrue (e is NotSupportedException, "CT#9");
269                         }
270
271                         try {
272                                 rconv.ConvertTo (null, CultureInfo.InvariantCulture,
273                                                  rect, typeof (int));
274                                 Assert.Fail ("CT#10: must throw NotSupportedException");
275                         } catch (Exception e) {
276                                 Assert.IsTrue (e is NotSupportedException, "CT#10");
277                         }
278                 }
279
280                 [Test]
281                 public void TestGetCreateInstanceSupported ()
282                 {
283                         Assert.IsTrue (rconv.GetCreateInstanceSupported (), "GCIS#1");
284                         Assert.IsTrue (rconv.GetCreateInstanceSupported (null), "GCIS#2");
285                 }
286
287                 [Test]
288                 public void TestCreateInstance ()
289                 {
290                         Rectangle rectInstance;
291
292                         Hashtable ht = new Hashtable ();
293                         ht.Add ("X", 10); ht.Add ("Y", 10);
294                         ht.Add ("Width", 20); ht.Add ("Height", 30);
295
296                         rectInstance = (Rectangle) rconv.CreateInstance (ht);
297                         Assert.AreEqual (rect, rectInstance, "CI#1");
298
299                         ht.Clear ();
300                         ht.Add ("X", -10); ht.Add ("Y", -10);
301                         ht.Add ("Width", 20); ht.Add ("Height", 30);
302
303                         rectInstance = (Rectangle) rconv.CreateInstance (null, ht);
304                         Assert.AreEqual (rectneg, rectInstance, "CI#2");
305
306                         // Property names are case-sensitive. It should throw 
307                         // NullRefExc if any of the property names does not match
308                         ht.Clear ();
309                         ht.Add ("x", -10); ht.Add ("Y", -10);
310                         ht.Add ("Width", 20); ht.Add ("Height", 30);
311                         try {
312                                 rectInstance = (Rectangle) rconv.CreateInstance (null, ht);
313                                 Assert.Fail ("CI#3: must throw NullReferenceException");
314                         } catch (Exception e) {
315                                 Assert.IsTrue (e is NullReferenceException, "CI#3");
316                         }
317                 }
318
319                 [Test]
320                 public void TestGetPropertiesSupported ()
321                 {
322                         Assert.IsTrue (rconv.GetPropertiesSupported (), "GPS#1");
323                         Assert.IsTrue (rconv.GetPropertiesSupported (null), "GPS#2");
324                 }
325
326                 [Test]
327                 public void TestGetProperties ()
328                 {
329                         Attribute [] attrs;
330                         PropertyDescriptorCollection propsColl;
331
332                         propsColl = rconv.GetProperties (rect);
333                         Assert.AreEqual (4, propsColl.Count, "GP1#1");
334                         Assert.AreEqual (rect.X, propsColl["X"].GetValue (rect), "GP1#2");
335                         Assert.AreEqual (rect.Y, propsColl["Y"].GetValue (rect), "GP1#3");
336                         Assert.AreEqual (rect.Width, propsColl["Width"].GetValue (rect), "GP1#4");
337                         Assert.AreEqual (rect.Height, propsColl["Height"].GetValue (rect), "GP1#5");
338
339                         propsColl = rconv.GetProperties (null, rectneg);
340                         Assert.AreEqual (4, propsColl.Count, "GP2#1");
341                         Assert.AreEqual (rectneg.X, propsColl["X"].GetValue (rectneg), "GP2#2");
342                         Assert.AreEqual (rectneg.Y, propsColl["Y"].GetValue (rectneg), "GP2#3");
343                         Assert.AreEqual (rectneg.Width, propsColl["Width"].GetValue (rectneg), "GP2#4");
344                         Assert.AreEqual (rectneg.Height, propsColl["Height"].GetValue (rectneg), "GP2#5");
345
346                         propsColl = rconv.GetProperties (null, rect, null);
347                         Assert.AreEqual (11, propsColl.Count, "GP3#1");
348                         Assert.AreEqual (rect.X, propsColl["X"].GetValue (rect), "GP3#2");
349                         Assert.AreEqual (rect.Y, propsColl["Y"].GetValue (rect), "GP3#3");
350                         Assert.AreEqual (rect.Width, propsColl["Width"].GetValue (rect), "GP3#4");
351                         Assert.AreEqual (rect.Height, propsColl["Height"].GetValue (rect), "GP3#5");
352
353                         Assert.AreEqual (rect.Top, propsColl["Top"].GetValue (rect), "GP3#6");
354                         Assert.AreEqual (rect.Bottom, propsColl["Bottom"].GetValue (rect), "GP3#7");
355                         Assert.AreEqual (rect.Left, propsColl["Left"].GetValue (rect), "GP3#8");
356                         Assert.AreEqual (rect.Right, propsColl["Right"].GetValue (rect), "GP3#9");
357                         Assert.AreEqual (rect.Location, propsColl["Location"].GetValue (rect), "GP3#10");
358                         Assert.AreEqual (rect.Size, propsColl["Size"].GetValue (rect), "GP3#11");
359                         Assert.AreEqual (rect.IsEmpty, propsColl["IsEmpty"].GetValue (rect), "GP3#12");
360
361                         Type type = typeof (Rectangle);
362                         attrs = Attribute.GetCustomAttributes (type, true);
363                         propsColl = rconv.GetProperties (null, rect, attrs);
364                         Assert.AreEqual (0, propsColl.Count, "GP3#13");
365                 }
366
367                 [Test]
368                 public void ConvertFromInvariantString_string ()
369                 {
370                         Assert.AreEqual (rect, rconv.ConvertFromInvariantString (rectStrInvariant),
371                                 "CFISS#1");
372                         Assert.AreEqual (rectneg, rconv.ConvertFromInvariantString (rectnegStrInvariant),
373                                 "CFISS#2");
374                 }
375
376                 [Test]
377                 [ExpectedException (typeof (ArgumentException))]
378                 public void ConvertFromInvariantString_string_exc_1 ()
379                 {
380                         rconv.ConvertFromInvariantString ("1, 2, 3");
381                 }
382
383                 [Test]
384                 public void ConvertFromInvariantString_string_exc_2 ()
385                 {
386                         try {
387                                 rconv.ConvertFromInvariantString ("hello");
388                                 Assert.Fail ("#1");
389                         } catch (Exception ex) {
390                                 Assert.AreEqual (typeof (Exception), ex.GetType (), "#2");
391                                 Assert.IsNotNull (ex.InnerException, "#3");
392                                 Assert.AreEqual (typeof (FormatException), ex.InnerException.GetType (), "#3");
393                         }
394                 }
395
396                 [Test]
397                 public void ConvertFromString_string ()
398                 {
399                         // save current culture
400                         CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
401
402                         try {
403                                 PerformConvertFromStringTest (new CultureInfo ("en-US"));
404                                 PerformConvertFromStringTest (new CultureInfo ("nl-BE"));
405                                 PerformConvertFromStringTest (new MyCultureInfo ());
406                         } finally {
407                                 // restore original culture
408                                 Thread.CurrentThread.CurrentCulture = currentCulture;
409                         }
410                 }
411
412                 [Test]
413                 [ExpectedException (typeof (ArgumentException))]
414                 public void ConvertFromString_string_exc_1 ()
415                 {
416                         CultureInfo culture = CultureInfo.CurrentCulture;
417                         rconv.ConvertFromString (string.Format(culture,
418                                 "1{0} 2{0} 3{0} 4{0} 5", culture.TextInfo.ListSeparator));
419                 }
420
421                 [Test]
422                 public void ConvertFromString_string_exc_2 ()
423                 {
424                         try {
425                                 rconv.ConvertFromString ("hello");
426                                 Assert.Fail ("#1");
427                         } catch (Exception ex) {
428                                 Assert.AreEqual (typeof (Exception), ex.GetType (), "#2");
429                                 Assert.IsNotNull (ex.InnerException, "#3");
430                                 Assert.AreEqual (typeof (FormatException), ex.InnerException.GetType (), "#3");
431                         }
432                 }
433
434                 [Test]
435                 public void ConvertToInvariantString_string ()
436                 {
437                         Assert.AreEqual (rectStrInvariant, rconv.ConvertToInvariantString (rect),
438                                 "CFISS#1");
439                         Assert.AreEqual (rectnegStrInvariant, rconv.ConvertToInvariantString (rectneg),
440                                 "CFISS#2");
441                 }
442
443                 [Test]
444                 public void ConvertToString_string () {
445                         // save current culture
446                         CultureInfo currentCulture = Thread.CurrentThread.CurrentCulture;
447
448                         try {
449                                 PerformConvertToStringTest (new CultureInfo ("en-US"));
450                                 PerformConvertToStringTest (new CultureInfo ("nl-BE"));
451                                 PerformConvertToStringTest (new MyCultureInfo ());
452                         } finally {
453                                 // restore original culture
454                                 Thread.CurrentThread.CurrentCulture = currentCulture;
455                         }
456                 }
457
458                 [Test]
459                 public void GetStandardValuesSupported ()
460                 {
461                         Assert.IsFalse (rconv.GetStandardValuesSupported ());
462                 }
463
464                 [Test]
465                 public void GetStandardValues ()
466                 {
467                         Assert.IsNull (rconv.GetStandardValues ());
468                 }
469
470                 [Test]
471                 public void GetStandardValuesExclusive ()
472                 {
473                         Assert.IsFalse (rconv.GetStandardValuesExclusive ());
474                 }
475
476                 private void PerformConvertFromStringTest (CultureInfo culture)
477                 {
478                         // set current culture
479                         Thread.CurrentThread.CurrentCulture = culture;
480
481                         // perform tests
482                         Assert.AreEqual (rect, rconv.ConvertFromString (CreateRectangleString (rect)),
483                                 "CFSS#1-" + culture.Name);
484                         Assert.AreEqual (rectneg, rconv.ConvertFromString (CreateRectangleString (rectneg)),
485                                 "CFSS#2-" + culture.Name);
486                 }
487
488                 private void PerformConvertToStringTest (CultureInfo culture)
489                 {
490                         // set current culture
491                         Thread.CurrentThread.CurrentCulture = culture;
492
493                         // perform tests
494                         Assert.AreEqual (CreateRectangleString (rect), rconv.ConvertToString (rect),
495                                 "CFISS#1-" + culture.Name);
496                         Assert.AreEqual (CreateRectangleString (rectneg), rconv.ConvertToString (rectneg),
497                                 "CFISS#2-" + culture.Name);
498                 }
499
500                 private static string CreateRectangleString (Rectangle rectangle)
501                 {
502                         return CreateRectangleString (CultureInfo.CurrentCulture, rectangle);
503                 }
504
505                 private static string CreateRectangleString (CultureInfo culture, Rectangle rectangle)
506                 {
507                         return string.Format ("{0}{1} {2}{1} {3}{1} {4}", rectangle.X.ToString (culture),
508                                 culture.TextInfo.ListSeparator, rectangle.Y.ToString (culture),
509                                 rectangle.Width.ToString (culture), rectangle.Height.ToString (culture));
510                 }
511
512                 [Serializable]
513                 private sealed class MyCultureInfo : CultureInfo
514                 {
515                         internal MyCultureInfo ()
516                                 : base ("en-US")
517                         {
518                         }
519
520                         public override object GetFormat (Type formatType)
521                         {
522                                 if (formatType == typeof (NumberFormatInfo)) {
523                                         NumberFormatInfo nfi = (NumberFormatInfo) ((NumberFormatInfo) base.GetFormat (formatType)).Clone ();
524
525                                         nfi.NegativeSign = "myNegativeSign";
526                                         return NumberFormatInfo.ReadOnly (nfi);
527                                 } else {
528                                         return base.GetFormat (formatType);
529                                 }
530                         }
531                 }
532         }
533 }