46 lines
938 B
C++
46 lines
938 B
C++
#ifdef _USE_GTEST
|
|
|
|
#ifndef test_mode_a_c_H
|
|
#define test_mode_a_c_H
|
|
#include "global.h"
|
|
|
|
|
|
class ModeACTest : public ::testing::Test {
|
|
protected:
|
|
void SetUp() override {
|
|
|
|
}
|
|
|
|
void TearDown() override {
|
|
// 如果有清理操作,可以放在这里
|
|
}
|
|
};
|
|
|
|
// 测试encode_mode_c函数
|
|
TEST_F(ModeACTest, ModeC) {
|
|
// 测试一个有效的高度
|
|
{
|
|
std::string result = encode_mode_c(10020);
|
|
//std::cout << decode_mode_c(result) << std::endl;
|
|
}
|
|
{
|
|
std::string result = encode_mode_c(2020);
|
|
//std::cout << decode_mode_c(result) << std::endl;
|
|
}
|
|
{
|
|
std::string result = encode_mode_c(10220);
|
|
//std::cout << decode_mode_c(result) << std::endl;
|
|
}
|
|
}
|
|
|
|
TEST_F(ModeACTest, ModeA) {
|
|
// 测试一个有效的高度
|
|
{
|
|
std::string result = encode_mode_a("1122");
|
|
//std::cout << decode_mode_a(result) << std::endl;
|
|
}
|
|
}
|
|
#endif
|
|
|
|
#endif
|