Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: test fixes on x86 (32bit) architecture #146

Merged
merged 3 commits into from
Mar 27, 2024
Merged

fix: test fixes on x86 (32bit) architecture #146

merged 3 commits into from
Mar 27, 2024

Conversation

madrisan
Copy link
Owner

No description provided.

Fix the following warning on 32-bits architectures:

    In file included from ../lib/container_docker_count.c:44,
                     from tslibcontainer_docker_count.c:33:
    ../lib/container_docker_count.c: In function 'docker_running_containers':
    ../include/logging.h:28:44: warning: format '%lu' expects argument of type 'long unsigned int',
                                but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
       28 | # define dbg(format, ...) fprintf (stdout, "DEBUG: " format, ##__VA_ARGS__)
          |                                            ^~~~~~~~~
    ../lib/container_docker_count.c:213:3: note: in expansion of macro 'dbg'
      213 |   dbg ("%lu bytes retrieved\n", chunk.size);
          |   ^~~

Signed-off-by: Davide Madrisan <[email protected]>
On Gentoo Base System release 2.14 for 32-bits

   (unsigned long)(6.26*100) = 625

So the test fails.
As a workaround modify the data file used by the test.

Signed-off-by: Davide Madrisan <[email protected]>
@madrisan madrisan self-assigned this Mar 27, 2024
@madrisan madrisan added the bug label Mar 27, 2024
@madrisan madrisan linked an issue Mar 27, 2024 that may be closed by this pull request
Fix the following errors:

     1) check function sizetollint with arg 1024b        ... OK
     2) check function sizetollint with arg 8k           ... OK
     3) check function sizetollint with arg 50m          ... OK
     4) check function sizetollint with arg 2g           ... OK
     5) check function sizetollint with arg 3t           ... FAILED
     6) check function sizetollint with arg 2p           ... FAILED
     7) check function sizetollint with arg 1024B        ... OK
     8) check function sizetollint with arg 8K           ... OK
     9) check function sizetollint with arg 50M          ... OK
    10) check function sizetollint with arg 2G           ... OK
    11) check function sizetollint with arg 3T           ... FAILED
    12) check function sizetollint with arg 2P           ... FAILED

The long int is not large enough on 32-bit architectures.

Signed-off-by: Davide Madrisan <[email protected]>
@madrisan madrisan merged commit 6c4f040 into main Mar 27, 2024
18 checks passed
@madrisan madrisan deleted the 32bit-fixes branch March 27, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] tslibxstrton_sizetoint64 fails on x86
1 participant