Skip to content

Commit a75db4b

Browse files
committed
affinity/tests: fix unit test for new yaml handling
New YAML handling parses the whole document or none of it. It won't partially parse a config file like the C version.
1 parent 5af113a commit a75db4b

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/util-affinity.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1997,15 +1997,10 @@ static int ThreadingAffinityTest27(void)
19971997
" - worker-cpu-set:\n" // Deprecated format
19981998
" cpu: [ 1, 2 ]\n";
19991999

2000-
SCConfYamlLoadString(config, strlen(config));
2000+
FAIL_IF(SCConfYamlLoadString(config, strlen(config)) != -1);
20012001
AffinitySetupLoadFromConfig();
20022002

2003-
ThreadsAffinityType *mgmt_taf = &thread_affinity[MANAGEMENT_CPU_SET];
2004-
ThreadsAffinityType *worker_taf = &thread_affinity[WORKER_CPU_SET];
2005-
// The first format should be picked-up and the other should be ignored
2006-
// For ignored formats, CPU_SET is initliazed as all cores
2007-
FAIL_IF(CPU_COUNT(&mgmt_taf->cpu_set) != 1 ||
2008-
CPU_COUNT(&worker_taf->cpu_set) != UtilCpuGetNumProcessorsOnline());
2003+
FAIL_IF_NOT_NULL(SCConfGetNode("threading"));
20092004

20102005
SCConfDeInit();
20112006
SCConfRestoreContextBackup();

0 commit comments

Comments
 (0)