Jan Breuer
2015-12-05 56f5bddb7e2a6267bdfeddf8de601a057aef802f
Extend expression.c tests
2个文件已修改
8 ■■■■■ 已修改文件
libscpi/src/expression.c 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/test/test_parser.c 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
libscpi/src/expression.c
@@ -245,6 +245,8 @@
            *dimensions = fromDimensions;
            return SCPI_EXPR_OK;
        }
    } else if (err == SCPI_EXPR_NO_MORE) {
        err = SCPI_EXPR_ERROR;
    }
    return err;
libscpi/test/test_parser.c
@@ -753,6 +753,8 @@
    TEST_NumericListDouble("(12,5:6:3)", 0, FALSE, 12, 0, SCPI_EXPR_OK, 0);
    TEST_NumericListDouble("(12,5:6:3)", 1, TRUE, 5, 6, SCPI_EXPR_OK, 0);
    TEST_NumericListDouble("(12,5:6:3)", 2, FALSE, 0, 0, SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR);
    TEST_NumericListDouble("(12,5:)", 2, FALSE, 0, 0, SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR);
    TEST_NumericListDouble("aaaa", 2, FALSE, 0, 0, SCPI_EXPR_ERROR, SCPI_ERROR_DATA_TYPE_ERROR);
}
#define NOPAREN(...) __VA_ARGS__
@@ -821,6 +823,10 @@
    TEST_ChannelList("(@1, 2)", 0, 1, FALSE, 1, (1), (0), SCPI_EXPR_OK, 0);
    TEST_ChannelList("(@1, 2)", 1, 1, FALSE, 0, (0), (0), SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR);
    TEST_ChannelList("(@1,)", 1, 1, FALSE, 0, (0), (0), SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR);
    TEST_ChannelList("(@1,2:)", 1, 1, FALSE, 0, (0), (0), SCPI_EXPR_ERROR, SCPI_ERROR_EXPRESSION_PARSING_ERROR);
    TEST_ChannelList("abcd", 1, 1, FALSE, 0, (0), (0), SCPI_EXPR_ERROR, SCPI_ERROR_DATA_TYPE_ERROR);
}