File: toutputchannelinfo.cpp

package info (click to toggle)
wsclean 3.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,296 kB
  • sloc: cpp: 129,246; python: 22,066; sh: 360; ansic: 230; makefile: 185
file content (37 lines) | stat: -rw-r--r-- 905 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "../../structures/outputchannelinfo.h"

#include <vector>

#include <boost/test/unit_test.hpp>

namespace wsclean {

BOOST_AUTO_TEST_SUITE(output_channel_info)

BOOST_AUTO_TEST_CASE(smallest_theoretic_beam_size) {
  OutputChannelInfo one;
  one.theoreticBeamSize = 1.0;
  OutputChannelInfo two;
  two.theoreticBeamSize = 2.0;
  OutputChannelInfo nan;
  nan.theoreticBeamSize = std::numeric_limits<double>::quiet_NaN();

  double result = SmallestTheoreticBeamSize({});
  BOOST_CHECK(std::isnan(result));

  result = SmallestTheoreticBeamSize({one});
  BOOST_CHECK_EQUAL(result, 1.0);

  result = SmallestTheoreticBeamSize({nan});
  BOOST_CHECK(std::isnan(result));

  result = SmallestTheoreticBeamSize({one, two});
  BOOST_CHECK_EQUAL(result, 1.0);

  result = SmallestTheoreticBeamSize({two, nan, one});
  BOOST_CHECK_EQUAL(result, 1.0);
}

BOOST_AUTO_TEST_SUITE_END()

}  // namespace wsclean