-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.cpp
More file actions
200 lines (198 loc) · 8.03 KB
/
Copy pathrun_tests.cpp
File metadata and controls
200 lines (198 loc) · 8.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#include "tests.h"
void run_tests() {
test_tuple_to_point();
test_tuple_to_vector();
test_tuple_addition();
test_point_minus_point();
test_point_minus_vector();
test_subtract_vector_from_zero_vector();
test_negate_tuple();
test_multiply_tuple_by_scalar();
test_divide_tuple_by_scalar();
test_magnitude_of_vector();
test_normalize_vector();
test_dot_product_vector();
test_cross_product_vector();
test_color_implementation();
test_color_addition();
test_color_subtraction();
test_color_multiplication_by_scalar();
test_color_multiply_by_color();
test_create_canvas();
test_writing_canvas();
test_canvas_to_ppm_header();
test_matrix_construction();
test_matrix_comparision_equal();
test_matrix_comparision_not_equal();
test_matrix_multiply();
test_matrix_tuple_multiply();
test_identity_matrix_multiplication();
test_matrix_transpose();
test_matrix_submatrix();
test_matrix_determinant_2x2();
test_matrix_minor_3x3();
test_matrix_cofactor();
test_matrix_determinant_large();
test_matrix_inversion();
test_matrix_translation();
test_matrix_scaling();
test_matrix_rotation_x();
test_matrix_rotation_x_inverse();
test_matrix_rotation_y();
test_matrix_rotation_z();
test_matrix_shearing();
test_individual_and_chained_transformations();
test_create_and_query_ray();
test_ray_point_from_dist();
test_sphere_ray_intersect_at_two_points();
test_sphere_ray_intersect_at_tangent();
test_sphere_ray_miss();
test_sphere_behind_ray();
test_hit_all_positive_t();
test_hit_some_negative_t();
test_hit_all_negative_t();
test_hit_lowest_non_negative_t();
test_translating_a_ray();
test_scaling_a_ray();
test_sphere_default_transformation();
test_sphere_transformation();
test_intersect_scaled_sphere_with_ray();
test_intersect_translated_sphere_with_ray();
test_normal_on_sphere_at_point_on_x_axis();
test_normal_on_sphere_at_point_on_y_axis();
test_normal_on_sphere_at_point_on_z_axis();
test_normal_on_sphere_at_non_axial_point();
test_normal_is_a_normalized_vector();
test_computing_normal_on_translated_sphere();
test_computing_normal_on_transformed_sphere();
test_reflecting_a_vector_approaching_at_45_degrees();
test_reflecting_a_vector_off_a_slanted_surface();
test_point_light_source();
test_default_material();
test_sphere_has_default_material();
test_sphere_may_be_assigned_a_material();
test_lighting_with_eye_between_light_and_surface();
test_lighting_with_eye_between_light_and_surface_eye_offset_45_degrees();
test_lighting_with_eye_opposite_surface_light_offset_45_degrees();
test_lighting_with_eye_in_the_path_of_the_reflection_vector();
test_lighting_with_the_light_behind_the_surface();
test_world_empty_on_creation();
test_default_world();
test_intersect_world_with_ray();
test_precomputing_state_of_intersection();
test_precomputing_state_of_intersection_inside();
test_shading_an_intersection();
test_shading_an_intersection_from_the_inside();
test_color_at_ray_misses();
test_color_at_ray_hits();
test_color_with_intersection_behind_the_ray();
test_view_transformation_default();
test_view_transformation_positive_z();
test_view_transformation_translation();
test_pixel_size_horizontal();
test_pixel_size_vertical();
test_ray_through_center_of_canvas();
test_ray_through_corner_of_canvas();
test_ray_with_transformed_camera();
test_rendering_a_world_with_a_camera();
test_lighting_with_surface_in_shadow();
test_no_shadow_collinear_point_and_light();
test_is_shadowed_with_obstruction();
test_is_shadowed_object_behind_light();
test_is_shadowed_object_behind_point();
test_hit_offset_point();
test_default_shape_transformation();
test_assigning_a_transformation_on_base_shape();
test_default_shape_has_default_material();
test_assigning_a_material_to_a_shape();
test_shape_intersection_encapsulates_material();
test_intersecting_a_scaled_shape_with_a_ray();
test_intersecting_a_translated_shape_with_a_ray();
test_computing_the_normal_on_a_translated_shape();
test_computing_the_normal_on_a_transformed_shape();
test_the_normal_of_a_plane_is_constant_everywhere();
test_intersect_with_a_ray_parallel_to_the_plane();
test_intersect_with_a_coplanar_ray();
test_a_ray_intersecting_a_plane_from_above();
test_a_ray_intersecting_a_plane_from_below();
test_create_stripe_pattern();
test_stripe_pattern_is_constant_in_y();
test_stripe_pattern_is_constant_in_z();
test_stripe_pattern_alternates_in_x();
test_lightning_with_pattern_applied();
test_stripe_pattern_with_object_transformation();
test_stripe_pattern_with_pattern_transformation();
test_stripe_pattern_with_both_transformations();
test_default_pattern_transformation();
test_assigning_a_transformation();
test_pattern_with_an_object_transformation();
test_pattern_with_a_pattern_transformation();
test_pattern_with_both_transformations();
test_gradient_pattern_interpolates();
test_ring_pattern_alternates_in_both_x_and_z();
test_checkers_pattern_alternates_in_x();
test_checkers_pattern_alternates_in_y();
test_checkers_pattern_alternates_in_z();
test_reflectivity_for_default_material();
test_precomupting_reflection_vector();
test_reflected_color_for_nonreflective_material();
test_reflected_color_for_reflective_material();
test_shade_hit_with_reflective_material();
test_reflected_color_prevents_infinite_recursion();
test_transparency_and_refractive_index_for_default_material();
test_glass_sphere_init();
test_finding_n1_and_n2_at_various_intersections();
test_under_point_offset_precomputation();
test_refracted_color_of_opaque_surface_is_black();
test_refracted_color_under_total_internal_reflection();
test_refracted_color_with_a_refracted_ray();
test_shade_hit_with_a_transparent_material();
test_schlick_approximation_under_total_internal_reflection();
test_schlick_approximation_with_a_perpendicular_viewing_angle();
test_schlick_approximation_with_a_grazing_angle();
test_shade_hit_with_a_reflective_transparent_material();
test_check_axis_behavior();
test_cube_intersections();
test_cube_normals();
test_ray_misses_a_cylinder();
test_ray_strikes_a_cylinder();
test_normal_vector_on_a_cylinder();
test_default_minimum_and_maximum();
test_intersecting_a_constrained_cylinder();
test_default_closed_value();
test_intersecting_caps_of_a_closed_cylinder();
test_normal_vector_on_a_cylinders_end_caps();
test_intersecting_a_cone_with_a_ray();
test_intersecting_cone_with_ray_parallel_to_one_half();
test_intersecting_a_cones_end_caps();
test_computing_the_normal_vector_on_a_cone();
test_creating_new_group();
test_add_child_to_group();
test_shape_has_parent();
test_ray_interesecting_with_empty_group();
test_ray_interesecting_with_non_empty_group();
test_intersecting_transformed_group();
test_converting_point_from_world_to_object_space();
test_converting_normal_from_object_to_world_space();
test_finding_the_normal_on_a_child_object();
test_constructing_a_triangle();
test_finding_the_normal_on_a_triangle();
test_intersecting_ray_parallel_to_the_triangle();
test_ray_misses_the_p1_p3_edge();
test_ray_misses_the_p1_p2_edge();
test_ray_misses_the_p2_p3_edge();
test_ray_strikes_a_triangle();
test_triangle_bounding_box();
test_ignoring_unrecognized_lines();
test_vertex_records();
test_parsing_triangle_faces();
test_triangulating_polygons();
test_triangles_in_named_groups();
test_constructing_smooth_triangle();
test_intersection_can_encapsulate_u_and_v();
test_intersecting_smooth_triangle_stores_uv();
test_smooth_triangle_interpolates_normal();
test_parser_recognizes_vertex_normals();
test_parser_creates_smooth_triangles();
test_faces_with_normal_vectors();
}