Skip to content
Snippets Groups Projects
Commit b4fdd9d5 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

rm test

parent 2d9c02c0
No related branches found
No related tags found
1 merge request!2003In GUI, remove option to switch beteen nm and angstrom, degrees and radians.
#include "Base/Const/Units.h"
#include "Device/Detector/IDetector.h"
#include "Device/Resolution/ConvolutionDetectorResolution.h"
#include "Device/Resolution/ResolutionFunction2DGaussian.h"
#include "GUI/Model/Detector/DetectorItem.h"
#include "GUI/Model/Detector/ResolutionFunctionItems.h"
#include "GUI/Model/Device/BackgroundItems.h"
#include "GUI/Model/Device/InstrumentItems.h"
#include "GUI/Model/Device/InstrumentModel.h"
#include "GUI/Support/Type/Unit.h"
#include "Tests/GTestWrapper/google_test.h"
TEST(TestDetectorItems, resolutionFunctionUnit)
{
const auto asString = [](const std::variant<QString, Unit>& unit) {
return std::holds_alternative<QString>(unit) ? std::get<QString>(unit)
: unitAsString(std::get<Unit>(unit));
};
DetectorItem detector;
detector.setResolutionFunctionType<ResolutionFunctionNoneItem>();
detector.setResolutionFunctionType<ResolutionFunction2DGaussianItem>();
auto* p = dynamic_cast<ResolutionFunction2DGaussianItem*>(
detector.resolutionFunctionSelection().currentItem());
EXPECT_NE(p, nullptr);
EXPECT_EQ(asString(p->sigmaX().unit()), "mm");
EXPECT_EQ(asString(p->sigmaY().unit()), "mm");
}
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