Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause 2 : : * Copyright(c) 2010-2014 Intel Corporation 3 : : */ 4 : : 5 : : #include <stdio.h> 6 : : #include <string.h> 7 : : #include <stdint.h> 8 : : 9 : : #include <rte_common.h> 10 : : #include <rte_version.h> 11 : : 12 : : #include "test.h" 13 : : 14 : : 15 : : static int 16 : 1 : test_version(void) 17 : : { 18 : 1 : const char *version = rte_version(); 19 [ + - ]: 1 : if (version == NULL) 20 : : return -1; 21 : : printf("Version string: '%s'\n", version); 22 [ + - ]: 1 : if (*version == '\0' || 23 [ - + ]: 1 : strncmp(version, RTE_VER_PREFIX, sizeof(RTE_VER_PREFIX)-1) != 0) 24 : 0 : return -1; 25 : : return 0; 26 : : } 27 : : 28 : 251 : REGISTER_FAST_TEST(version_autotest, true, true, test_version);