~lttng/lttng-ust/lttng-ust

« back to all changes in this revision

Viewing changes to tests/unit/libcommon/get_max_cpuid_from_sysfs.c

  • Committer: Mathieu Desnoyers
  • Author(s): Michael Jeanson
  • Date: 2022-07-29 14:33:10 UTC
  • Revision ID: git-v1:fb0f6ca9385e1813311cfd917c130b40bec04970
Add more unit tests for possible_cpus_array_len

Change-Id: If0b7fb9183936f00ac90349fb32f1db57f124602
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * SPDX-License-Identifier: LGPL-2.1-only
 
3
 *
 
4
 * Copyright (C) 2022 Michael Jeanson <mjeanson@efficios.com>
 
5
 */
 
6
 
 
7
#include <stdio.h>
 
8
#include <stdlib.h>
 
9
 
 
10
#include "common/smp.h"
 
11
 
 
12
int main(int argc, char *argv[])
 
13
{
 
14
        int ret;
 
15
 
 
16
        if( argc < 2 ) {
 
17
                fprintf(stderr, "Missing argument.\n");
 
18
                return EXIT_FAILURE;
 
19
        }
 
20
 
 
21
        ret = _get_max_cpuid_from_sysfs(argv[1]);
 
22
 
 
23
        printf("%d\n", ret);
 
24
 
 
25
        if (ret >= 0)
 
26
                return EXIT_SUCCESS;
 
27
        else
 
28
                return EXIT_FAILURE;
 
29
}