Skip to content

Commit 323ea12

Browse files
Antti Kauppilaadbridge
authored andcommitted
LoraPhy and regions unit test skeletons added
1 parent b1c62a9 commit 323ea12

File tree

20 files changed

+806
-0
lines changed

20 files changed

+806
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "gtest/gtest.h"
19+
#include "LoRaPHY.h"
20+
21+
22+
class my_LoRaPHY : public LoRaPHY
23+
{
24+
public:
25+
my_LoRaPHY(){};
26+
27+
virtual ~my_LoRaPHY(){};
28+
};
29+
30+
class Test_LoRaPHY : public testing::Test {
31+
protected:
32+
my_LoRaPHY *object;
33+
34+
virtual void SetUp()
35+
{
36+
object = new my_LoRaPHY();
37+
}
38+
39+
virtual void TearDown()
40+
{
41+
delete object;
42+
}
43+
};
44+
45+
TEST_F(Test_LoRaPHY, constructor)
46+
{
47+
EXPECT_TRUE(object);
48+
}
49+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#[[
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
]]
17+
18+
# Unit test suite name
19+
set(TEST_SUITE_NAME "lorawan_LoRaPHY")
20+
21+
# Source files
22+
set(unittest-sources
23+
../features/lorawan/lorastack/phy/LoRaPHY.cpp
24+
)
25+
26+
# Add test specific include paths
27+
set(unittest-includes ${unittest-includes}
28+
target_h
29+
../features/lorawan/lorastack/phy
30+
)
31+
32+
# Test & stub files
33+
set(unittest-test-sources
34+
../features/lorawan/loraphy/Test_LoRaPHY.cpp
35+
stubs/LoRaWANTimer_stub.cpp
36+
37+
)
38+
39+
40+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 -DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true")
41+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH=8 -DMBED_CONF_LORA_DUTY_CYCLE_ON_JOIN=true")
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "gtest/gtest.h"
19+
#include "LoRaPHYAS923.h"
20+
21+
class Test_LoRaPHYAS923 : public testing::Test {
22+
protected:
23+
LoRaPHYAS923 *object;
24+
25+
virtual void SetUp()
26+
{
27+
object = new LoRaPHYAS923();
28+
}
29+
30+
virtual void TearDown()
31+
{
32+
delete object;
33+
}
34+
};
35+
36+
TEST_F(Test_LoRaPHYAS923, constructor)
37+
{
38+
EXPECT_TRUE(object);
39+
}
40+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#[[
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
]]
17+
18+
# Unit test suite name
19+
set(TEST_SUITE_NAME "lorawan_LoRaPHYAS923")
20+
21+
# Source files
22+
set(unittest-sources
23+
../features/lorawan/lorastack/phy/LoRaPHYAS923.cpp
24+
)
25+
26+
# Add test specific include paths
27+
set(unittest-includes ${unittest-includes}
28+
target_h
29+
../features/lorawan/lorastack/phy
30+
)
31+
32+
# Test & stub files
33+
set(unittest-test-sources
34+
../features/lorawan/loraphyas923/Test_LoRaPHYAS923.cpp
35+
stubs/LoRaPHY_stub.cpp
36+
stubs/LoRaWANTimer_stub.cpp
37+
38+
)
39+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "gtest/gtest.h"
19+
#include "LoRaPHYAU915.h"
20+
21+
class Test_LoRaPHYAU915 : public testing::Test {
22+
protected:
23+
LoRaPHYAU915 *object;
24+
25+
virtual void SetUp()
26+
{
27+
object = new LoRaPHYAU915();
28+
}
29+
30+
virtual void TearDown()
31+
{
32+
delete object;
33+
}
34+
};
35+
36+
TEST_F(Test_LoRaPHYAU915, constructor)
37+
{
38+
EXPECT_TRUE(object);
39+
}
40+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#[[
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
]]
17+
18+
# Unit test suite name
19+
set(TEST_SUITE_NAME "lorawan_LoRaPHYAU915")
20+
21+
# Source files
22+
set(unittest-sources
23+
../features/lorawan/lorastack/phy/LoRaPHYAU915.cpp
24+
)
25+
26+
# Add test specific include paths
27+
set(unittest-includes ${unittest-includes}
28+
target_h
29+
../features/lorawan/lorastack/phy
30+
)
31+
32+
# Test & stub files
33+
set(unittest-test-sources
34+
../features/lorawan/loraphyau915/Test_LoRaPHYAU915.cpp
35+
stubs/LoRaPHY_stub.cpp
36+
stubs/LoRaWANTimer_stub.cpp
37+
38+
)
39+
40+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"")
41+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMBED_CONF_LORA_FSB_MASK=\"{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0x00FF}\"")
42+
43+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "gtest/gtest.h"
19+
#include "LoRaPHYCN470.h"
20+
21+
class Test_LoRaPHYCN470 : public testing::Test {
22+
protected:
23+
LoRaPHYCN470 *object;
24+
25+
virtual void SetUp()
26+
{
27+
object = new LoRaPHYCN470();
28+
}
29+
30+
virtual void TearDown()
31+
{
32+
delete object;
33+
}
34+
};
35+
36+
TEST_F(Test_LoRaPHYCN470, constructor)
37+
{
38+
EXPECT_TRUE(object);
39+
}
40+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#[[
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
]]
17+
18+
# Unit test suite name
19+
set(TEST_SUITE_NAME "lorawan_LoRaPHYCN470")
20+
21+
# Source files
22+
set(unittest-sources
23+
../features/lorawan/lorastack/phy/LoRaPHYCN470.cpp
24+
)
25+
26+
# Add test specific include paths
27+
set(unittest-includes ${unittest-includes}
28+
target_h
29+
../features/lorawan/lorastack/phy
30+
)
31+
32+
# Test & stub files
33+
set(unittest-test-sources
34+
../features/lorawan/loraphycn470/Test_LoRaPHYCN470.cpp
35+
stubs/LoRaPHY_stub.cpp
36+
stubs/LoRaWANTimer_stub.cpp
37+
38+
)
39+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2018, Arm Limited and affiliates
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "gtest/gtest.h"
19+
#include "LoRaPHYCN779.h"
20+
21+
class Test_LoRaPHYCN779 : public testing::Test {
22+
protected:
23+
LoRaPHYCN779 *object;
24+
25+
virtual void SetUp()
26+
{
27+
object = new LoRaPHYCN779();
28+
}
29+
30+
virtual void TearDown()
31+
{
32+
delete object;
33+
}
34+
};
35+
36+
TEST_F(Test_LoRaPHYCN779, constructor)
37+
{
38+
EXPECT_TRUE(object);
39+
}
40+

0 commit comments

Comments
 (0)