-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathat_command_frame_test.cc
More file actions
35 lines (29 loc) · 1.02 KB
/
Copy pathat_command_frame_test.cc
File metadata and controls
35 lines (29 loc) · 1.02 KB
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
#include <cstdint>
#include <vector>
#include <gtest/gtest.h>
#include "at_command.h"
#include "at_command_frame.h"
namespace at_command_frame_test
{
TEST(ATCommandFrameTest, ConstValuesSpec)
{
ASSERT_EQ(std::vector<uint8_t>(), at_command_frame::REGISTER_QUERY);
}
TEST(ATCommandFrameTest, GetATCommand)
{
ASSERT_EQ(at_command::SERIAL_NUMBER_LOW,
at_command_frame(at_command::SERIAL_NUMBER_LOW).get_at_command());
}
TEST(ATCommandFrameTest, OperatorVectorTestRegisterQuery)
{
ASSERT_EQ(std::vector<uint8_t>({0x08, 0x01, 0x43, 0x48}),
static_cast<std::vector<uint8_t>>(at_command_frame(
at_command::CHANNEL, at_command_frame::REGISTER_QUERY, true)));
}
TEST(ATCommandFrameTest, OperatorVectorTestRegisterConfiguration)
{
ASSERT_EQ(std::vector<uint8_t>({0x08, 0x01, 0x50, 0x4c, 0x02}),
static_cast<std::vector<uint8_t>>(
at_command_frame(at_command::POWER_LEVEL, {0x02}, true)));
}
}