Skip to content

Commit

Permalink
Shorten test string for B&W radios.
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz committed Nov 10, 2023
1 parent 8e503bf commit 9b5339c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions radio/src/tests/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ static const char* _model_config[] =
{
// As written by radio firmware - always enclosed in double quotes
"header: \n"
" name: \"Test Name\"\n", // no embedded double quote
" name: \"Tst Name\"\n", // no embedded double quote

"header: \n"
" name: \"Test \\x22 Name\"\n", // embedded and encoded double quote
" name: \"Tst \\x22 Name\"\n", // embedded and encoded double quote

// As written by Companion - only enclosed in double quotes when necessary
"header: \n"
" name: Test Name\n", // no embedded double quote
" name: Tst Name\n", // no embedded double quote

"header: \n"
" name: Test \" Name\n", // embedded double quote in string
" name: Tst \" Name\n", // embedded double quote in string

"header: \n"
" name: \"\\\"Test Name\"\n", // embedded double quote at start of string
" name: \"\\\"Tst Name\"\n", // embedded double quote at start of string
};

static void loadModelYamlStr(const char* str)
Expand All @@ -69,13 +69,13 @@ static char* modelName()
TEST(Model, testModelNameParse)
{
loadModelYamlStr(_model_config[0]);
EXPECT_STREQ(modelName(), "Test Name");
EXPECT_STREQ(modelName(), "Tst Name");
loadModelYamlStr(_model_config[1]);
EXPECT_STREQ(modelName(), "Test \" Name");
EXPECT_STREQ(modelName(), "Tst \" Name");
loadModelYamlStr(_model_config[2]);
EXPECT_STREQ(modelName(), "Test Name");
EXPECT_STREQ(modelName(), "Tst Name");
loadModelYamlStr(_model_config[3]);
EXPECT_STREQ(modelName(), "Test \" Name");
EXPECT_STREQ(modelName(), "Tst \" Name");
loadModelYamlStr(_model_config[4]);
EXPECT_STREQ(modelName(), "\"Test Name");
EXPECT_STREQ(modelName(), "\"Tst Name");
}

0 comments on commit 9b5339c

Please sign in to comment.