1 // RUNNABLE_PHOBOS_TEST
2 // PERMUTE_ARGS: -unittest -O -release -inline -fPIC -g
3
4 extern(C) int printf(const char*, ...);
5 extern(C) int sprintf(char*, const char*, ...);
6
7 /**************************************/
8
test1()9 void test1()
10 {
11 bool x;
12 int i;
13
14 i = !("bar" == "bar");
15 assert(i == 0);
16
17 i = "bar" != "bar";
18 assert(i == 0);
19
20 i = "bar" == "bar";
21 assert(i == 1);
22
23 x = "bar" != "bar";
24 assert(x == false);
25
26 assert("bar" == "bar");
27
28 x = "bar" == "bar";
29 assert(x == true);
30
31 /+ ---- +/
32
33 i = !("foo" == "bar");
34 assert(i == 1);
35
36 i = "foo" != "bar";
37 assert(i == 1);
38
39 i = "foo" == "bar";
40 assert(i == 0);
41
42 x = "foo" != "bar";
43 assert(x == true);
44
45 assert("foo" != "bar");
46
47 x = "foo" == "bar";
48 assert(x == false);
49
50 }
51
52
53 /**************************************/
54
test2()55 void test2()
56 {
57 bool x;
58 int i;
59
60 i = !("bar" <= "bar");
61 assert(i <= 0);
62
63 i = "bar" > "bar";
64 assert(i == 0);
65
66 i = "bar" >= "bar";
67 assert(i == 1);
68
69 x = "bar" < "bar";
70 assert(x == false);
71
72 assert("bar" <= "bar");
73
74 x = "bar" <= "bar";
75 assert(x == true);
76
77 /+ ---- +/
78
79 i = !("foo" < "bar");
80 assert(i == 1);
81
82 i = "foo" > "bar";
83 assert(i == 1);
84
85 i = "foo" < "bar";
86 assert(i == 0);
87
88 x = "foo" >= "bar";
89 assert(x == true);
90
91 assert("foo" >= "bar");
92
93 x = "foo" <= "bar";
94 assert(x == false);
95
96 }
97
98
99 /**************************************/
100
all(string array,bool function (char)predicate)101 bool all(string array, bool function(char) predicate) {
102 for (int i = 0; i < array.length; i++) {
103 if (!predicate(array[i])) {
104 return false;
105 }
106 }
107 return true;
108 }
109
all(string array,bool delegate (char)predicate)110 bool all(string array, bool delegate(char) predicate) {
111 for (int i = 0; i < array.length; i++) {
112 if (!predicate(array[i])) {
113 return false;
114 }
115 }
116 return true;
117 }
118
isVowel(char c)119 bool isVowel(char c) {
120 return (c == 'a') || (c == 'e') || (c == 'i') || (c == 'o') || (c == 'u');
121 }
122
123 class Character {
124 private char letter;
this(char c)125 this(char c) {
126 this.letter = c;
127 }
isLetter(char c)128 public bool isLetter(char c) {
129 return this.letter == c;
130 }
131 }
132
test3()133 void test3()
134 {
135 Character a = new Character('a');
136 bool delegate(char) isLetter;
137 isLetter = &a.isLetter;
138 bool i;
139
140 i = all("aeiouoeieuiei", &isVowel);
141 assert(i == true);
142
143 i = all("aeiouoeieuiei", isLetter);
144 assert(i == false);
145 }
146
147
148 /**************************************/
149
fun(int i)150 int[] fun(int i)
151 in
152 {
153 assert(i > 0);
154 }
out(result)155 out (result)
156 {
157 assert(result[0] == 2);
158 }
159 body
160 {
161 char result;
162 int[] res = new int[10];
163 res[] = i;
164 int isZero = (result == 0xFF);
165 assert(isZero);
166 return res;
167 }
168
test4()169 void test4()
170 {
171 int[] values = fun(2);
172 }
173
174
175 /**************************************/
176
177
178 const uint D3DSP_DSTMOD_SHIFT = 20;
179
180 const uint D3DSP_DSTMOD_MASK = 0x00F00000;
181
182
183 enum D3DSHADER_PARAM_DSTMOD_TYPE
184
185 {
186 NONE = 0<<D3DSP_DSTMOD_SHIFT,
187 SATURATE= 1<<D3DSP_DSTMOD_SHIFT,
188 FORCE_DWORD = 0x7fffffff,
189 }
190
test5()191 void test5()
192 {
193 }
194
195 /**************************************/
196
197 class foo6
198 {
199 union
200 {
201 int i;
202 char j;
203 }
204 }
205
206 void test6()
207 {
208 }
209
210 /**************************************/
211
212 void test7()
213 {
214 }
215
216
217 /**************************************/
218
219 real x8 = 4;
220 long y8;
221
222 void test8()
223 {
224 y8 = cast(long)x8;
225 assert(y8 == 4);
226 y8 = cast(long)cast(double)x8;
227 assert(y8 == 4);
228 printf ("%lld\n", y8);
229 }
230
231
232 /**************************************/
233
234 void test9()
235 {
236 struct B { }
237 B bar (ref int p)
238 {
239 B b;
240 return b;
241 }
242 }
243
244
245 /**************************************/
246
247 struct B10
248 {
249 uint member;
250 }
251
252 B10 func10()
253 {
254 B10 b;
255 b.member=7;
256 return b;
257 }
258
259 void test10()
260 {
261 uint i=func10().member; // Internal error: ..\ztc\cgcs.c 350
262 assert(i == 7);
263
264 B10 b=func10(); //works
265 i=b.member;
266 assert(i == 7);
267 }
268
269
270 /**************************************/
271
272 void test11()
273 {
274 const int notInitialized;
275 const int i=notInitialized; // DMD crashes
276 assert(notInitialized == 0);
277 assert(i == 0);
278 }
279
280
281 /**************************************/
282
283 struct Array12
284 {
285 char len;
286 void* p;
287 }
288 //Array12 f12(string a)
289 //{
290 // return *cast(Array12*) &a[0..23]; //Internal error: ..\ztc\cgcs.c 350
291 //}
292
293 Array12 g12(string a)
294 {
295 return *cast(Array12*) &a; //works
296 }
297
298 void test12()
299 {
300 string a = "12345678901234567890123";
301 Array12 b;
302
303 //b = f12(a);
304 //printf("b.len = %x\n", b.len);
305 b = g12(a);
306 printf("b.len = %x\n", b.len);
307 }
308
309
310 /**************************************/
311
312
313 class A13
314 {
315 int opShl(char* v) { return 1; }
316 int opShl(string v) { return 2; }
317 }
318
319 void test13()
320 {
321 A13 a = new A13();
322 int i;
323 i = a.opShl(cast(string)"");
324 assert(i == 2);
325 i = a << cast(string)"";
326 assert(i == 2);
327 }
328
329 /**************************************/
330
331 union U1
332 {
333 struct { int a; }
334 struct { int b; }
335 }
336
337 union U2
338 {
339 struct { int a; }
340 struct { long b; }
341 }
342
343 union U3
344 {
345 struct { long a; }
346 struct { int b; }
347 }
348
349 union U4
350 {
351 int a;
352 int b;
353 }
354
355 union U5
356 {
357 int a;
358 long b;
359 }
360
361 union U6
362 {
363 long a;
364 int b;
365 }
366
367 void test14()
368 {
369 printf("%d %d %d\n", U1.a.offsetof, U1.b.offsetof, U1.sizeof);
370 assert(U1.a.offsetof == 0);
371 assert(U1.b.offsetof == 0);
372 assert(U1.sizeof == 4);
373
374 printf("%d %d %d\n", U2.a.offsetof, U2.b.offsetof, U2.sizeof);
375 assert(U2.a.offsetof == 0);
376 assert(U2.b.offsetof == 0);
377 assert(U2.sizeof == 8);
378
379 printf("%d %d %d\n", U3.a.offsetof, U3.b.offsetof, U3.sizeof);
380 assert(U3.a.offsetof == 0);
381 assert(U3.b.offsetof == 0);
382 assert(U3.sizeof == 8);
383
384 printf("%d %d %d\n", U4.a.offsetof, U4.b.offsetof, U4.sizeof);
385 assert(U4.a.offsetof == 0);
386 assert(U4.b.offsetof == 0);
387 assert(U4.sizeof == 4);
388
389 printf("%d %d %d\n", U5.a.offsetof, U5.b.offsetof, U5.sizeof);
390 assert(U5.a.offsetof == 0);
391 assert(U5.b.offsetof == 0);
392 assert(U5.sizeof == 8);
393
394 printf("%d %d %d\n", U6.a.offsetof, U6.b.offsetof, U6.sizeof);
395 assert(U6.a.offsetof == 0);
396 assert(U6.b.offsetof == 0);
397 assert(U6.sizeof == 8);
398 }
399
400
401 /**************************************/
402
403 void test15()
404 {
405 const int[] array = [1,2,3];
406
407 assert(array.length == 3);
408 assert(array[1] == 2);
409 }
410
411
412 /**************************************/
413
414 class Conversion(T)
415 {
416 class Big {char[2] dummy;}
417 static Big Test(...);
418
419 enum { exists = Test().sizeof }
420 }
421
422 void test16()
423 {
424 assert(Conversion!(double).exists == (void*).sizeof);
425 }
426
427
428 /**************************************/
429
430 class Cout17
431 {
432 Cout17 set(int x)
433 {
434 printf("%d",x);
435 return this;
436 }
437 alias set opShl;
438 }
439
440 void test17()
441 {
442 Cout17 cout = new Cout17;
443 cout << 5 << 4;
444 }
445
446
447
448 /**************************************/
449
450 void test18()
451 {
452 bool[] x = new bool[100];
453 x[] = 1;
454 bool[] y = x.dup;
455 assert(y[99]);
456 }
457
458
459 /**************************************/
460
461 bool[32] x19 = 1;
462
463 void test19()
464 {
465 assert(x19[31]);
466 }
467
468
469 /**************************************/
470
471 bool[2] y20 = [ cast(bool) 3, cast(bool) 2 ];
472
473 void test20()
474 {
475 assert(y20[0]); // ok
476 assert(y20[1]); // fails
477 }
478
479 /**************************************/
480
481 bool isnan(float x) { return !( (x >= 0) || (x < 0)); }
482
483 struct X21 { float f, g, h; }
484 X21 x21_1;
485 X21 x21_2 = { f: 1.0, h: 2.0 };
486
487 char[3] y21_1;
488 char[3] y21_2 = [ 0: 'a', 2: 'b' ];
489
490 void test21()
491 {
492 assert(isnan(x21_1.g));
493 assert(isnan(x21_2.g));
494 assert(y21_1[1] == '\xff');
495 assert(y21_2[1] == '\xff');
496 }
497
498
499 /**************************************/
500
501 void test22()
502 {
503 wstring a = cast(wstring)"一〇";
504 }
505
506
507 /**************************************/
508
509 interface A23 { void x(); }
510 class B23 : A23 { void x() { } }
511 class C23 : B23 { uint y = 12345678; }
512
513 void stest23(A23 a)
514 {
515 synchronized (a)
516 {
517 }
518 }
519
520 void test23()
521 {
522 C23 c = new C23;
523 assert(c.y == 12345678 /*c.y.init*/);
524 stest23(c);
525 assert(c.y == 12345678 /*c.y.init*/);
526 }
527
528
529 /**************************************/
530
531 class A24
532 {
533 unittest
534 {
535 }
536 }
537
538 void test24()
539 {
540 }
541
542 /**************************************/
543
544 char rot13(char ret)
545 {
546 if (ret > 'A'-1 && ret < 'N')
547 { ret += 13;}
548 else if(ret > 'M' && ret < 'Z'+1)
549 { ret -= 13;}
550 else if(ret > 'a'-1 && ret < 'n')
551 { ret += 13;}
552 else if(ret > 'm' && ret < 'z'+1)
553 { ret -= 13;}
554
555 return ret;
556 }
557
558
559 void test25()
560 {
561 foreach (char c; "hello World\n")
562 printf("%c %c\n", c, rot13(c));
563 assert(rot13('h') == 'u');
564 assert(rot13('o') == 'b');
565 assert(rot13('W') == 'J');
566 assert(rot13('H') == 'U');
567 }
568
569
570 /**************************************/
571
572 bool b26a = cast(bool)( cast(bool) 2 & cast(bool) 1 );
573 bool b26b = cast(bool) 2;
574
575 void test26()
576 {
577 assert( (* cast(byte *) & b26a) == 1 );
578 assert( (* cast(byte *) & b26b) == 1 );
579 }
580
581
582 /**************************************/
583
584 int c27;
585
586 struct X27
587 {
588 int x;
589 struct
590 {
591 int a;
592 int b;
593 static this() { c27 = 3; }
594 }
595 }
596
597 void test27()
598 {
599 assert(c27 == 3);
600 }
601
602 /**************************************/
603
604 void test28()
605 {
606 void bar()
607 {
608 throw new Foo28();
609 }
610 }
611
612 class Foo28 : Throwable
613 {
614 private:
615 this() { super(""); }
616 }
617
618 /**************************************/
619
620 struct S29 {
621 ubyte a, b, c, d;
622 }
623
624 int hoge(S29 s) {
625 char[10] b;
626 printf("%x\n", *cast(int*)&s);
627 sprintf(b.ptr, "%x", *cast(int*)&s);
628 version (LittleEndian)
629 assert(b[0 .. 7] == "4030201");
630 version (BigEndian)
631 assert(b[0 .. 7] == "1020304");
632 return 0;
633 }
634
635 void test29()
636 {
637 for (int i = 0; i < 1; i++) {
638 S29 s;
639 s.a = 1;
640 s.b = 2;
641 s.c = 3;
642 s.d = 4;
643 hoge(s);
644 }
645 }
646
647
648 /**************************************/
649
650 class Qwert {
651 static {
652 deprecated int yuiop() {
653 return 42;
654 }
655 }
656
657 static deprecated int asdfg() {
658 return yuiop() + 105;
659 }
660 }
661
662 void test30()
663 {
664 }
665
666 /**************************************/
667
668 void test31()
669 {
670 string foo = "hello";
671
672 printf("%s\n", foo.ptr);
673 auto s = typeid(typeof(foo.ptr)).toString();
674 printf("%.*s\n", s.length, s.ptr);
675 s = typeid(char*).toString();
676 printf("%.*s\n", s.length, s.ptr);
677 assert(typeid(typeof(foo.ptr)) == typeid(immutable(char)*));
678 }
679
680 /**************************************/
681
682 class Qwert32
683 {
684 struct
685 {
686 int yuiop = 13;
687 }
688 int asdfg = 42;
689
690 void foo()
691 {
692 printf("yuiop = %d, asdfg = %d\n", Qwert32.yuiop.offsetof, Qwert32.asdfg.offsetof);
693 version(D_LP64)
694 {
695 assert(Qwert32.yuiop.offsetof == 16);
696 assert(Qwert32.asdfg.offsetof == 20);
697 }
698 else
699 {
700 assert(Qwert32.yuiop.offsetof == 8);
701 assert(Qwert32.asdfg.offsetof == 12);
702 }
703 }
704 }
705
706 void test32()
707 {
708 Qwert32 q = new Qwert32;
709
710 q.foo();
711 }
712
713
714 /**************************************/
715
716 int x33;
717 int y33;
718
719 size_t os_query()
720 {
721 return cast(uint)(cast(char *)&x33 - cast(char *)&y33);
722 }
723
724 void test33()
725 {
726 os_query();
727 }
728
729 /**************************************/
730
731 uint x34 = ~(16u-1u);
732 uint y34 = ~(16u-1);
733
734 void test34()
735 {
736 assert(x34 == 0xFFFFFFF0);
737 assert(y34 == 0xFFFFFFF0);
738 }
739
740 /**************************************/
741
742 private static extern (C)
743 {
744 shared char* function () uloc_getDefault;
745 }
746
747
748 static shared void**[] targets =
749 [
750 cast(shared(void*)*) &uloc_getDefault,
751 ];
752
753 void test35()
754 {
755 }
756
757 /**************************************/
758
759 class S36
760 {
761 int s = 1;
762
763 this()
764 {
765 }
766 }
767
768
769 class A36 : S36
770 {
771 int a = 2;
772 int b = 3;
773 int c = 4;
774 int d = 5;
775 }
776
777 void test36()
778 {
779 A36 a = new A36;
780
781 printf("A36.sizeof = %d\n", a.classinfo.initializer.length);
782 printf("%d\n", a.s);
783 printf("%d\n", a.a);
784 printf("%d\n", a.b);
785 printf("%d\n", a.c);
786 printf("%d\n", a.d);
787
788 version(D_LP64)
789 assert(a.classinfo.initializer.length == 36);
790 else
791 assert(a.classinfo.initializer.length == 28);
792 assert(a.s == 1);
793 assert(a.a == 2);
794 assert(a.b == 3);
795 assert(a.c == 4);
796 assert(a.d == 5);
797 }
798
799
800 /**************************************/
801
802 struct MyStruct
803 {
804 StructAlias* MyStruct()
805 {
806 return null;
807 }
808 }
809
810 alias MyStruct StructAlias;
811
812 void test37()
813 {
814 }
815
816 /**************************************/
817
818 class Foo38
819 {
820 static void display_name()
821 {
822 printf("%.*s\n", Object.classinfo.name.length, Object.classinfo.name.ptr);
823 assert(Object.classinfo.name == "object.Object");
824 assert(super.classinfo.name == "object.Object");
825 assert(this.classinfo.name == "test12.Foo38");
826 }
827 }
828
829 void test38()
830 {
831 Foo38.display_name();
832 }
833
834
835 /**************************************/
836 // http://www.digitalmars.com/d/archives/digitalmars/D/bugs/2409.html
837
838 class C39
839 {
840 C39 c;
841 this() { c = this; }
842 C39 lock() { return c; }
843 }
844
845 void test39()
846 {
847 C39 c = new C39();
848 synchronized( c.lock() ) {}
849 synchronized( c.lock ) {}
850 }
851
852
853 /**************************************/
854
855 class C40
856 {
857 static int x = 4;
858
859 static int foo()
860 {
861 return this.x;
862 }
863 }
864
865 void test40()
866 {
867 C40 c = new C40();
868 assert(C40.foo() == 4);
869 }
870
871
872 /**************************************/
873
874 struct Foo42
875 {
876 Bar42 b;
877 }
878
879 struct Bar42
880 {
881 long a;
882 }
883
884 void test42()
885 {
886 assert(Bar42.sizeof == long.sizeof);
887 assert(Foo42.sizeof == long.sizeof);
888 }
889
890
891 /**************************************/
892
893 class Foo43
894 {
895 Bar43 b;
896 }
897
898 struct Bar43
899 {
900 long a;
901 }
902
903 void test43()
904 {
905 assert(Bar43.sizeof == long.sizeof);
906 assert(Foo43.sizeof == (void*).sizeof);
907 }
908
909
910 /**************************************/
911
912 struct Property
913 {
914 uint attributes;
915
916 Value value;
917 }
918
919 struct Value
920 {
921 int a,b,c,d;
922 }
923
924 struct PropTable
925 {
926 Property[Value] table;
927 PropTable* previous;
928
929 Value* get(Value* key)
930 {
931 Property *p;
932
933 p = *key in table;
934 p = &table[*key];
935 table.remove(*key);
936 return null;
937 }
938
939 }
940
941 void test44()
942 {
943 }
944
945
946 /**************************************/
947
948 struct Shell
949 {
950 string str;
951
952 const int opCmp(ref const Shell s)
953 {
954 import std.algorithm;
955 return std.algorithm.cmp(this.str, s.str);
956 }
957 }
958
959 void test45()
960 {
961 import std.algorithm;
962
963 Shell[3] a;
964
965 a[0].str = "hello";
966 a[1].str = "betty";
967 a[2].str = "fred";
968
969 a[].sort;
970
971 foreach (Shell s; a)
972 {
973 printf("%.*s\n", s.str.length, s.str.ptr);
974 }
975
976 assert(a[0].str == "betty");
977 assert(a[1].str == "fred");
978 assert(a[2].str == "hello");
979 }
980
981 /**************************************/
982
983 class A46
984 {
985 char foo() { return 'a'; }
986 }
987
988 class B46 : A46
989 {
990 }
991
992 class C46 : B46
993 {
994 override char foo() { return 'c'; }
995 char bar()
996 {
997 return B46.foo();
998 }
999 }
1000
1001 void test46()
1002 {
1003 C46 c = new C46();
1004
1005 assert(c.bar() == 'a');
1006 printf("%c\n", c.bar());
1007 }
1008
1009
1010 /**************************************/
1011
1012 class Foo47
1013 {
1014 static bool prop() { return false; }
1015 static string charprop() { return null; }
1016 }
1017
1018 void test47()
1019 {
1020 if (0 || Foo47.prop) { }
1021 if (1 && Foo47.prop) { }
1022 switch (Foo47.prop) { default: break; }
1023 foreach (char ch; Foo47.charprop) { }
1024 }
1025
1026
1027 /**************************************/
1028
1029 struct foo48
1030 {
1031 int x, y, z;
1032 }
1033
1034 void bar48() {}
1035
1036 void test48()
1037 {
1038 foo48[] arr;
1039 foreach(foo48 a; arr)
1040 {
1041 bar48();
1042 }
1043 }
1044
1045
1046 /**************************************/
1047
1048 enum E49;
1049
1050 void test49()
1051 {
1052 }
1053
1054 /**************************************/
1055
1056 void test50()
1057 {
1058 S50!() s;
1059 assert(s.i == int.sizeof);
1060 }
1061
1062 struct S50()
1063 {
1064 int i=f50(0).sizeof;
1065 }
1066
1067 int f50(...);
1068
1069 /**************************************/
1070
1071 enum Enum51
1072 {
1073 A,
1074 B,
1075 C
1076 }
1077
1078 struct Struct51
1079 {
1080 Enum51 e;
1081 }
1082
1083 void test51()
1084 {
1085 Struct51 s;
1086 assert(s.e == Enum51.A);
1087 assert(s.e == 0);
1088 }
1089
1090 /**************************************/
1091
1092 bool foo52()
1093 {
1094 int x;
1095 for (;;) {
1096 if (x == 0)
1097 return true;
1098 x = 1;
1099 }
1100 return false;
1101 }
1102
1103 void test52()
1104 {
1105 foo52();
1106 }
1107
1108 /**************************************/
1109
1110 void foo53()
1111 {
1112 ret:{}
1113 goto ret;
1114 }
1115
1116 void test53()
1117 {
1118 }
1119
1120 /**************************************/
1121
1122 struct V54
1123 {
1124 int x = 3;
1125 }
1126
1127 class Foo54
1128 {
1129 static int y;
1130 static V54 prop() { V54 val; return val; }
1131 static void prop(V54 val) { y = val.x * 2; }
1132 }
1133
1134 void test54()
1135 {
1136 (new Foo54).prop = true ? Foo54.prop : Foo54.prop;
1137 assert(Foo54.y == 6);
1138 }
1139
1140 /**************************************/
1141
1142 void test55()
1143 {
1144 dchar c;
1145
1146 c = 'x';
1147 //writefln("c = '%s', c.init = '%s'", c, c.init);
1148 assert(c == 'x');
1149 assert(c.init == dchar.init);
1150 }
1151
1152 /**************************************/
1153
1154 void writefln(string s)
1155 {
1156 printf("%.*s\n", s.length, s.ptr);
1157 }
1158
1159 void test58()
1160 {
1161 int label=1;
1162 if (0)
1163 {
1164 label:
1165 int label2=2;
1166 assert(label2==2);
1167 }
1168 else
1169 {
1170 assert(label==1);
1171 goto label;
1172 }
1173 assert(label==1);
1174 }
1175
1176 /**************************************/
1177
1178 void test59()
1179 {
1180 if(0){
1181 label:
1182 return;
1183 }else{
1184 goto label;
1185 }
1186 assert(0);
1187 }
1188
1189 /**************************************/
1190
1191 int main(string[] argv)
1192 {
1193 test1();
1194 test2();
1195 test3();
1196 test4();
1197 test5();
1198 test6();
1199 test7();
1200 test8();
1201 test9();
1202 test10();
1203 test11();
1204 test12();
1205 test13();
1206 test14();
1207 test15();
1208 test16();
1209 test17();
1210 test18();
1211 test19();
1212 test20();
1213 test21();
1214 test22();
1215 test23();
1216 test24();
1217 test25();
1218 test26();
1219 test27();
1220 test28();
1221 test29();
1222 test30();
1223 test31();
1224 test32();
1225 test33();
1226 test34();
1227 test35();
1228 test36();
1229 test37();
1230 test38();
1231 test39();
1232 test40();
1233 test42();
1234 test43();
1235 test44();
1236 test45();
1237 test46();
1238 test47();
1239 test48();
1240 test49();
1241 test50();
1242 test51();
1243 test52();
1244 test53();
1245 test54();
1246 test55();
1247 test58();
1248 test59();
1249
1250 printf("Success\n");
1251 return 0;
1252 }
1253
1254