Skip to content
Snippets Groups Projects
Commit ca73d847 authored by Sam Jenkins's avatar Sam Jenkins
Browse files

Re #23574 updated unit tests

parent 7d9b8963
No related branches found
No related tags found
No related merge requests found
#ifndef LOAD_BINSTL_TEST_H_
#define LOAD_BINSTL_TEST_H_
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/Sample.h"
......@@ -39,8 +42,8 @@ void test_cube() {
TS_ASSERT_EQUALS(cube->numberOfTriangles(), 12);
TS_ASSERT_DELTA(cube->volume(), 3000, 0.001);
}
//test removed because currently no cylinderBin.stl
void xtest_cylinder() {
void test_cylinder() {
std::string path = FileFinder::Instance().getFullPath("cylinderBin.stl");
std::unique_ptr<LoadBinStl> Loader = std::make_unique<LoadBinStl>(path);
auto cylinder = Loader->readStl();
......@@ -59,16 +62,19 @@ void test_cube() {
TS_ASSERT_EQUALS(tube->numberOfTriangles(), 2160);
TS_ASSERT_DELTA(tube->volume(), 7068, 1);
}
//check that isBinaryStl returns false if the file contains an incomplete vertex
void test_fail_invalid_vertex() {
std::string path = FileFinder::Instance().getFullPath("invalid_vertexBin.stl");
std::unique_ptr<LoadBinStl> Loader = std::make_unique<LoadBinStl>(path);
TS_ASSERT(!(Loader->isBinarySTL()));
}
//check that isBinaryStl returns false if the file contains an incomplete triangle
void test_fail_invalid_triangle() {
std::string path = FileFinder::Instance().getFullPath("invalid_triangleBin.stl");
std::unique_ptr<LoadBinStl> Loader = std::make_unique<LoadBinStl>(path);
TS_ASSERT(!(Loader->isBinarySTL()));
}
};
\ No newline at end of file
};
//add tests for isBinaryStl e.g. attempting to load an ascii .stl
#endif /* LOAD_BINSTL_TEST_H_ */
\ No newline at end of file
8371032c426dd1dc102156c9d8987dd9
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment