Temporary commit for X10 conversions fixes
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -97,10 +97,20 @@ TEST(Conversions, ConversionX7From22)
|
||||
#endif
|
||||
|
||||
#if defined(PCBX10)
|
||||
TEST(Conversions, ConversionHorusFrom22)
|
||||
TEST(X10Conversions, ConversionRadioFrom22)
|
||||
{
|
||||
simuFatfsSetPaths(TESTS_PATH "/tests/", TESTS_PATH "/tests/");
|
||||
loadModel("model_22_horus.bin");
|
||||
loadRadioSettings("/radio_22_x10.bin");
|
||||
|
||||
EXPECT_EQ(218, g_eeGeneral.version);
|
||||
EXPECT_STRNEQ("en", g_eeGeneral.ttsLanguage);
|
||||
EXPECT_STRNEQ("model1.bin", g_eeGeneral.currModelFilename);
|
||||
}
|
||||
|
||||
TEST(X10Conversions, ConversionModelFrom22)
|
||||
{
|
||||
simuFatfsSetPaths(TESTS_PATH "/tests/", TESTS_PATH "/tests/");
|
||||
loadModel("model_22_x10.bin");
|
||||
|
||||
EXPECT_ZSTREQ("Test", g_model.header.name);
|
||||
EXPECT_EQ(80, g_model.mixData[0].weight);
|
||||
|
||||
@@ -134,16 +134,27 @@ uint16_t getAnalogValue(uint8_t index)
|
||||
return anaIn(index);
|
||||
}
|
||||
|
||||
static char _zchar2stringResult[200];
|
||||
static char _stringResult[200];
|
||||
const char * zchar2string(const char * zstring, int size)
|
||||
{
|
||||
if (size > (int)sizeof(_zchar2stringResult) ) {
|
||||
return 0;
|
||||
if (size > (int)sizeof(_stringResult) ) {
|
||||
return nullptr;
|
||||
}
|
||||
zchar2str(_zchar2stringResult, zstring, size);
|
||||
return _zchar2stringResult;
|
||||
zchar2str(_stringResult, zstring, size);
|
||||
return _stringResult;
|
||||
}
|
||||
|
||||
const char * nchar2string(const char * string, int size)
|
||||
{
|
||||
if (size > (int)sizeof(_stringResult) ) {
|
||||
return nullptr;
|
||||
}
|
||||
strncpy(_stringResult, string, size);
|
||||
_stringResult[size] = '\0';
|
||||
return _stringResult;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
@@ -36,7 +36,9 @@ extern uint16_t anaInValues[NUM_STICKS+NUM_POTS+NUM_SLIDERS];
|
||||
void doMixerCalculations();
|
||||
|
||||
extern const char * zchar2string(const char * zstring, int size);
|
||||
extern const char * nchar2string(const char * string, int size);
|
||||
#define EXPECT_ZSTREQ(c_string, z_string) EXPECT_STREQ(c_string, zchar2string(z_string, sizeof(z_string)))
|
||||
#define EXPECT_STRNEQ(c_string, n_string) EXPECT_STREQ(c_string, nchar2string(n_string, sizeof(n_string)))
|
||||
|
||||
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||
#define RADIO_RESET() \
|
||||
|
||||
Reference in New Issue
Block a user