app/test: fix hash multiwriter sequence
Hash multiwriter test consists of two subtests.
If the any of the subtests fails, the overall test should fail,
but the overall test only passed if the second subtest passed,
because the return of the first subtest was being overwritten.
Fixes: be856325cb
("hash: add scalable multi-writer insertion with Intel TSX")
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
This commit is contained in:
parent
d3ab8f9737
commit
4f117ebda0
@ -247,8 +247,6 @@ test_hash_multiwriter(void)
|
|||||||
static int
|
static int
|
||||||
test_hash_multiwriter_main(void)
|
test_hash_multiwriter_main(void)
|
||||||
{
|
{
|
||||||
int r = -1;
|
|
||||||
|
|
||||||
if (rte_lcore_count() == 1) {
|
if (rte_lcore_count() == 1) {
|
||||||
printf("More than one lcore is required to do multiwriter test\n");
|
printf("More than one lcore is required to do multiwriter test\n");
|
||||||
return 0;
|
return 0;
|
||||||
@ -268,14 +266,16 @@ test_hash_multiwriter_main(void)
|
|||||||
printf("Test multi-writer with Hardware transactional memory\n");
|
printf("Test multi-writer with Hardware transactional memory\n");
|
||||||
|
|
||||||
use_htm = 1;
|
use_htm = 1;
|
||||||
r = test_hash_multiwriter();
|
if (test_hash_multiwriter() < 0)
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Test multi-writer without Hardware transactional memory\n");
|
printf("Test multi-writer without Hardware transactional memory\n");
|
||||||
use_htm = 0;
|
use_htm = 0;
|
||||||
r = test_hash_multiwriter();
|
if (test_hash_multiwriter() < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
return r;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGISTER_TEST_COMMAND(hash_multiwriter_autotest, test_hash_multiwriter_main);
|
REGISTER_TEST_COMMAND(hash_multiwriter_autotest, test_hash_multiwriter_main);
|
||||||
|
Loading…
Reference in New Issue
Block a user