Guest User

Untitled

a guest
Oct 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. #1 "Tests/EXTADTTest.m"
  2. #1 "Tests/EXTADTTest.m" 1
  3. #1 "<built-in>" 1
  4. #1 "<built-in>" 3
  5. #152 "<built-in>" 3
  6. #1 "<command line>" 1
  7. #1 "<built-in>" 2
  8. #1 "Tests/EXTADTTest.m" 2
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17. #1 "Tests/EXTADTTest.h" 1
  18. #10 "Tests/EXTADTTest.h"
  19. #1 "Modules/EXTADT.h" 1
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. #1 "./metamacros.h" 1
  29. #10 "Modules/EXTADT.h" 2
  30. #11 "Tests/EXTADTTest.h" 2
  31.  
  32. @ interface EXTADTTest:SenTestCase
  33.  
  34. @ end
  35. #10 "Tests/EXTADTTest.m" 2
  36.  
  37. typedef unsigned char Red_unused__junk_17, _ADT_17_Red_aliases0;
  38. typedef unsigned char Green_unused__junk_17, _ADT_17_Green_aliases0;
  39. typedef unsigned char Blue_unused__junk_17, _ADT_17_Blue_aliases0;
  40. typedef double alpha_junk_17, _ADT_17_Gray_aliases0;
  41. typedef unsigned char Gray_unused__junk_17, _ADT_17_Gray_aliases1;
  42. typedef double r_junk_17, _ADT_17_Other_aliases0;
  43. typedef double g_junk_17, _ADT_17_Other_aliases1;
  44. typedef double b_junk_17, _ADT_17_Other_aliases2;
  45. typedef unsigned char Other_unused__junk_17, _ADT_17_Other_aliases3;
  46. typedef struct _ADT_17
  47. {
  48. void *tag;
  49. union
  50. {
  51. struct
  52. {
  53. unsigned char Red_unused_;
  54. };
  55. struct _ADT_17_Red_aliases
  56. {
  57. _ADT_17_Red_aliases0 v0;
  58. } Red;
  59. struct
  60. {
  61. unsigned char Green_unused_;
  62. };
  63. struct _ADT_17_Green_aliases
  64. {
  65. _ADT_17_Green_aliases0 v0;
  66. } Green;
  67. struct
  68. {
  69. unsigned char Blue_unused_;
  70. };
  71. struct _ADT_17_Blue_aliases
  72. {
  73. _ADT_17_Blue_aliases0 v0;
  74. } Blue;
  75. struct
  76. {
  77. double alpha;
  78. unsigned char Gray_unused_;
  79. };
  80. struct _ADT_17_Gray_aliases
  81. {
  82. _ADT_17_Gray_aliases0 v0;
  83. _ADT_17_Gray_aliases1 v1;
  84. } Gray;
  85. struct
  86. {
  87. double r;
  88. double g;
  89. double b;
  90. unsigned char Other_unused_;
  91. };
  92. struct _ADT_17_Other_aliases
  93. {
  94. _ADT_17_Other_aliases0 v0;
  95. _ADT_17_Other_aliases1 v1;
  96. _ADT_17_Other_aliases2 v2;
  97. _ADT_17_Other_aliases3 v3;
  98. } Other;
  99. };
  100. } Color;
  101. static inline struct _ADT_17
  102. Red()
  103. {
  104. struct _ADT_17 s;
  105. s.tag = (__typeof__(s.tag)) & Red;
  106. struct _ADT_17_Red_aliases *entry __attribute__((unused)) = &s.Red;
  107. return s;
  108. } static inline struct _ADT_17
  109. Green()
  110. {
  111. struct _ADT_17 s;
  112. s.tag = (__typeof__(s.tag)) & Green;
  113. struct _ADT_17_Green_aliases *entry __attribute__((unused)) = &s.Green;
  114. return s;
  115. } static inline struct _ADT_17
  116. Blue()
  117. {
  118. struct _ADT_17 s;
  119. s.tag = (__typeof__(s.tag)) & Blue;
  120. struct _ADT_17_Blue_aliases *entry __attribute__((unused)) = &s.Blue;
  121. return s;
  122. } static inline struct _ADT_17
  123. Gray(_ADT_17_Gray_aliases0 v0)
  124. {
  125. struct _ADT_17 s;
  126. s.tag = (__typeof__(s.tag)) & Gray;
  127. struct _ADT_17_Gray_aliases *entry __attribute__((unused)) = &s.Gray;
  128. entry->v0 = v0;
  129. return s;
  130. } static inline struct _ADT_17
  131. Other(_ADT_17_Other_aliases0 v0, _ADT_17_Other_aliases1 v1, _ADT_17_Other_aliases2 v2)
  132. {
  133. struct _ADT_17 s;
  134. s.tag = (__typeof__(s.tag)) & Other;
  135. struct _ADT_17_Other_aliases *entry __attribute__((unused)) = &s.Other;
  136. entry->v0 = v0;
  137. entry->v1 = v1;
  138. entry->v2 = v2;
  139. return s;
  140. };
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148. @implementation EXTADTTest
  149.  
  150. - (void)testConstruction
  151. {
  152. Color c1 = Red();
  153. STAssertTrue(c1.tag == Red, @"");
  154.  
  155. Color c2 = Other(1.0, 0.5, 0.25);
  156. STAssertTrue(c2.tag == Other, @"");
  157. STAssertEqualsWithAccuracy(c2.r, 1.0, 0.0001, @"");
  158. STAssertEqualsWithAccuracy(c2.g, 0.5, 0.0001, @"");
  159. STAssertEqualsWithAccuracy(c2.b, 0.25, 0.0001, @"");
  160.  
  161. Color c3 = Gray(0.75);
  162. STAssertTrue(c3.tag == Gray, @"");
  163. STAssertEqualsWithAccuracy(c3.alpha, 0.75, 0.0001, @"");
  164. }
  165.  
  166. @end
Add Comment
Please, Sign In to add comment