Name consistency

This commit is contained in:
Godzil
2020-02-20 14:48:11 +00:00
parent 14c3044acf
commit 863bb2a34b
9 changed files with 28 additions and 28 deletions

View File

@@ -21,7 +21,7 @@ TEST(CanvasTest, Creating_a_canvas)
{
for(x = 0; x < 10; x++)
{
ASSERT_EQ(c.get_pixel(x, y), Colour(0, 0, 0));
ASSERT_EQ(c.getPixel(x, y), Colour(0, 0, 0));
}
}
}
@@ -31,9 +31,9 @@ TEST(CanvasTest, Test_Writing_pixels_to_a_canvas_Test)
Canvas c = Canvas(10, 20);
Colour red = Colour(1, 0, 0);
c.put_pixel(2, 3, red);
c.putPixel(2, 3, red);
ASSERT_EQ(c.get_pixel(2, 3), red);
ASSERT_EQ(c.getPixel(2, 3), red);
}
@@ -44,9 +44,9 @@ TEST(CanvasTest, Save_a_PNG_file)
Colour c2 = Colour(0, 0.5, 0);
Colour c3 = Colour(-0.5, 0, 1);
c.put_pixel(0, 0, c1);
c.put_pixel(2, 1, c2);
c.put_pixel(4, 2, c3);
c.putPixel(0, 0, c1);
c.putPixel(2, 1, c2);
c.putPixel(4, 2, c3);
ASSERT_TRUE(c.SaveAsPNG("Save_a_PNG_file.png"));

View File

@@ -36,7 +36,7 @@ int main()
if (!xs.hit().nothing())
{
c.put_pixel(x, y, red);
c.putPixel(x, y, red);
}
}
}

View File

@@ -47,7 +47,7 @@ int main()
Tuple eye = -r.direction;
Colour pixelColour = hit.object->material.lighting(light, hitPoint, eye, hitNormalVector);
c.put_pixel(x, y, pixelColour);
c.putPixel(x, y, pixelColour);
}
}

View File

@@ -168,7 +168,7 @@ TEST(SphereTest, Computing_the_normal_on_a_tranformed_sphere)
{
Sphere s = Sphere();
s.setTransform(scaling(1, 0.5, 1) * rotation_z(M_PI / 5));
s.setTransform(scaling(1, 0.5, 1) * rotationZ(M_PI / 5));
Tuple n = s.normalAt(Point(0, sqrt(2)/2, -sqrt(2)/2));

View File

@@ -78,8 +78,8 @@ TEST(TransformationTest, Reflexion_is_scaling_by_a_negative_value)
TEST(TransformationTest, Rotating_a_point_around_the_X_axis)
{
Point p = Point(0, 1, 0);
Matrix half_quarter = rotation_x(M_PI / 4.);
Matrix full_quarter = rotation_x(M_PI / 2.);
Matrix half_quarter = rotationX(M_PI / 4.);
Matrix full_quarter = rotationX(M_PI / 2.);
ASSERT_EQ(half_quarter * p, Point(0, sqrt(2)/2, sqrt(2)/2));
ASSERT_EQ(full_quarter * p, Point(0, 0, 1));
@@ -88,7 +88,7 @@ TEST(TransformationTest, Rotating_a_point_around_the_X_axis)
TEST(TransformationTest, The_inverse_of_an_x_rotation_rotates_in_the_opposite_direction)
{
Point p = Point(0, 1, 0);
Matrix half_quarter = rotation_x(M_PI / 4.);
Matrix half_quarter = rotationX(M_PI / 4.);
Matrix inv = half_quarter.inverse();
ASSERT_EQ(inv * p, Point(0, sqrt(2)/2, -sqrt(2)/2));
@@ -97,8 +97,8 @@ TEST(TransformationTest, The_inverse_of_an_x_rotation_rotates_in_the_opposite_di
TEST(TransformationTest, Rotating_a_point_around_the_Y_axis)
{
Point p = Point(0, 0, 1);
Matrix half_quarter = rotation_y(M_PI / 4.);
Matrix full_quarter = rotation_y(M_PI / 2.);
Matrix half_quarter = rotationY(M_PI / 4.);
Matrix full_quarter = rotationY(M_PI / 2.);
ASSERT_EQ(half_quarter * p, Point(sqrt(2)/2, 0, sqrt(2)/2));
ASSERT_EQ(full_quarter * p, Point(1, 0, 0));
@@ -107,8 +107,8 @@ TEST(TransformationTest, Rotating_a_point_around_the_Y_axis)
TEST(TransformationTest, Rotating_a_point_around_the_Z_axis)
{
Point p = Point(0, 1, 0);
Matrix half_quarter = rotation_z(M_PI / 4.);
Matrix full_quarter = rotation_z(M_PI / 2.);
Matrix half_quarter = rotationZ(M_PI / 4.);
Matrix full_quarter = rotationZ(M_PI / 2.);
ASSERT_EQ(half_quarter * p, Point(-sqrt(2)/2, sqrt(2)/2, 0));
ASSERT_EQ(full_quarter * p, Point(-1, 0, 0));
@@ -165,7 +165,7 @@ TEST(TransformationTest, A_shearing_transformation_moves_z_in_proportion_to_y)
TEST(TransformationTest, Individual_trnasformations_are_applied_in_sequence)
{
Point p = Point(1, 0, 1);
Matrix A = rotation_x(M_PI / 2.);
Matrix A = rotationX(M_PI / 2.);
Matrix B = scaling(5, 5, 5);
Matrix C = translation(10, 5, 7);
@@ -182,7 +182,7 @@ TEST(TransformationTest, Individual_trnasformations_are_applied_in_sequence)
TEST(TransformationTest, Chained_transformation_must_be_applied_in_reverse_order)
{
Point p = Point(1, 0, 1);
Matrix A = rotation_x(M_PI / 2.);
Matrix A = rotationX(M_PI / 2.);
Matrix B = scaling(5, 5, 5);
Matrix C = translation(10, 5, 7);