Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
ConfigTest.cpp
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #include "cheetah/fldo/test/ConfigTest.h"
25 #include "cheetah/fldo/Config.h"
26 #include "cheetah/fldo/CommonDefs.h"
27 
28 
29 namespace ska {
30 namespace cheetah {
31 namespace fldo {
32 namespace test {
33 
34 
35 ConfigTest::ConfigTest()
36  : ::testing::Test()
37 {
38 }
39 
40 ConfigTest::~ConfigTest()
41 {
42 }
43 
44 void ConfigTest::SetUp()
45 {
46 }
47 
48 void ConfigTest::TearDown()
49 {
50 }
51 
52 TEST_F(ConfigTest, test_pool)
53 {
54  utils::Config::SystemType system;
55  typedef panda::PoolManagerConfig<utils::Config::SystemType> PoolManagerConfigType;
56  PoolManagerConfigType pool_manager_config;
57  Config::PoolManagerType manager(system, pool_manager_config);
58  fldo::ConfigType config(manager);
59  auto pool = config.pool();
60 }
61 
62 //
63 // test_correct_config
64 // This test programs a correct parameter Configuration
65 // frequecies.
66 TEST_F(ConfigTest, test_correct_config)
67 {
68  Config config;
69  fldo::cuda::Config& cuda_config = config.cuda_algo_config();
70 
71  // correct values
72  cuda_config.phases(fldo::o_phases);
73  cuda_config.nsubbands(fldo::o_bands);
74  cuda_config.nsubints(fldo::o_subints);
75  //
76  int res = cuda_config.fldo_input_check(cuda_config);
77  ASSERT_EQ(0 , res );
78 }
79 
80 //
81 // test_wrong_config
82 // This test programs an incorrect parameter Configuration
83 // frequecies.
84 TEST_F(ConfigTest, test_wrong_config)
85 {
86  Config config;
87  fldo::cuda::Config& cuda_config = config.cuda_algo_config();
88 
89  // correct values
90  cuda_config.phases(fldo::o_phases);
91  cuda_config.nsubbands(fldo::o_bands);
92  cuda_config.nsubints(fldo::max_subints + 1);
93  ASSERT_GT(0 , cuda_config.fldo_input_check(cuda_config));
94 }
95 
96 
97 
98 } // namespace test
99 } // namespace fldo
100 } // namespace cheetah
101 } // namespace ska
Some limits and constants for FLDO.
Definition: Brdz.h:35