Implementation of core/data/anglemapp.cpp and utest/core/local/21_bounds.cpp
In the clean up process, Im undertaking, this is one thing I wanted to take a closer look, since it looks so strange:
#include "base/geo/angles.h"
#include <QCR/base/debug.h> // ASSERT
#include <vector>
namespace {
...
} // namespace
#ifndef LOCAL_CODE_ONLY
#include "core/data/angle_map.h"
#include "core/data/session.h"
#include <iostream> // for debugging
#include <qmath.h>
AngleMap::AngleMap(const deg tth)
{
size_ = gSession->imageSize();
...
and utest/core/local/21_bounds.cpp
#define LOCAL_CODE_ONLY
#include "3rdparty/catch2/catch.hpp"
#include "core/data/angle_map.cpp"
const double e = 1e-15;
TEST_CASE("Bounds - LowerBound", "")
{
for (int n = 2; n < 12; ++n) {
std::vector<deg> v(n);
for (int i = 0; i < n; ++i)
v[i] = i;
CHECK(0 == lowerBound(v, Q_QNAN, 0, n));
CHECK(0 == lowerBound(v, -1e99, 0, n));
CHECK(0 == lowerBound(v, -e, 0, n));
CHECK(0 == lowerBound(v, 0., 0, n));
CHECK(1 == lowerBound(v, +e, 0, n));
CHECK(1 == lowerBound(v, 1. - e, 0, n));
...
By removing this preprocessor definition and #ifndef and also linking this test_21 against stecacore everything seems to compile, link and run fine. Therefore I do not understand why this was implemented. @j.wuttke Is there a reason for this?