Skip to content

Commit

Permalink
Fix build error of type-parameterized test.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Mar 13, 2016
1 parent 9ee9b30 commit e6334d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions sources/integrator/integrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ void SamplerIntegrator::render(const Scene& scene,
const Ray ray = camera_->spawnRay(Point2i(x, y), randFilm, randLens);

const Point2i pixel(width - x - 1, y);
camera_->film()->
addPixel(pixel, randFilm,
Li(scene, params, ray, *samplers[threadID], arenas[threadID]));
camera_->film()->addPixel(pixel, randFilm,
Li(scene, params, ray, *samplers[threadID],
arenas[threadID]));
}
}
arenas[threadID].reset();
Expand Down
2 changes: 1 addition & 1 deletion sources/integrator/integrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class SPICA_EXPORTS SamplerIntegrator : public Integrator {
Sampler& sampler,
MemoryArena& arena,
int depth = 0) const = 0;

Spectrum specularReflect(const Scene& scene,
const RenderParameters& params,
const Ray& ray,
Expand Down
2 changes: 1 addition & 1 deletion sources/random/halton.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SPICA_EXPORTS Halton : public Sampler {

bool startNextSample() override;

std::unique_ptr<Sampler> clone(unsigned int seed = 0) const;
std::unique_ptr<Sampler> clone(unsigned int seed = 0) const override;

private:
double radicalInverse(int n, int base, const int* p) const;
Expand Down
11 changes: 6 additions & 5 deletions test/test_scene.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "gtest/gtest.h"

#include <memory>
#include <string>
#include <type_traits>

Expand All @@ -25,7 +26,7 @@ class SceneTypedTest : public ::testing::Test {
prims.emplace_back(new GeometricPrimitive(s1, nullptr, nullptr));
prims.emplace_back(new GeometricPrimitive(s2, nullptr, nullptr));
auto bvh = std::make_shared<AccelType>(prims);
scene = Scene(bvh, lights);
this->scene = Scene(bvh, lights);
}

virtual void TearDown() {
Expand All @@ -44,15 +45,15 @@ TYPED_TEST_CASE_P(SceneTypedTest);
TYPED_TEST_P(SceneTypedTest, IntersectionTest) {
SurfaceInteraction isect;
Ray ray(Point3d(0.0, 0.0, 10.0), Vector3d(0.0, 0.0, -1.0));
EXPECT_TRUE(scene.intersect(ray));
EXPECT_TRUE(scene.intersect(ray, &isect));
EXPECT_TRUE(this->scene.intersect(ray));
EXPECT_TRUE(this->scene.intersect(ray, &isect));

EXPECT_NE(isect.primitive(), nullptr);
EXPECT_EQ(Point3d(0.0, 0.0, 5.0), isect.pos());

ray = Ray(Point3d(0.0, 0.0, 10.0), Vector3d(0.0, 1.0, 0.0));
EXPECT_FALSE(scene.intersect(ray));
EXPECT_FALSE(scene.intersect(ray, &isect));
EXPECT_FALSE(this->scene.intersect(ray));
EXPECT_FALSE(this->scene.intersect(ray, &isect));
}

REGISTER_TYPED_TEST_CASE_P(SceneTypedTest, IntersectionTest);
Expand Down

0 comments on commit e6334d9

Please sign in to comment.