Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #247757

Re: CUnit - A Unit Testing Framework for C

Path csiph.com!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!reader02.eternal-september.org!news.mixmin.net!news2.arglkargh.de!news.karotte.org!news.uzoreto.com!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!bofh.it!news.nic.it!robomod
From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: CUnit - A Unit Testing Framework for C
Date Sat, 30 Apr 2022 13:40:02 +0200
Message-ID <EhTCa-cd0f-7@gated-at.bofh.it> (permalink)
References <EhLEB-c8lP-5@gated-at.bofh.it> <EhLOh-c8p5-5@gated-at.bofh.it> <EhNwK-c9xW-5@gated-at.bofh.it>
X-Mailbox-Line From debian-user-request@lists.debian.org Sat Apr 30 11:30:28 2022
Old-Return-Path <greg@wooledge.org>
X-Amavis-Spam-Status No, score=-6.117 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, FOURLA=0.1, LDO_WHITELIST=-5, RDNS_NONE=0.793, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate: -4.6
Mail-Followup-To debian-user@lists.debian.org
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
X-Mailing-List <debian-user@lists.debian.org> archive/latest/788648
List-ID <debian-user.lists.debian.org>
List-URL <https://lists.debian.org/debian-user/>
List-Archive https://lists.debian.org/msgid-search/Ym0dwl9/eqMV7nbs@wooledge.org
Approved robomod@news.nic.it
Lines 42
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Sat, 30 Apr 2022 07:30:10 -0400
X-Original-Message-ID <Ym0dwl9/eqMV7nbs@wooledge.org>
X-Original-References <CAGiORHdpot3NxBQKbWGfJN26v3tgGyF0+oVeeigEd1GXVhmhug@mail.gmail.com> <YmypdydAe5m2S6Dr@wooledge.org> <CAGiORHcKgCbpnLJiVHXsS0+FumqsA34imyvOT+hekTNv6G7Y0w@mail.gmail.com>
Xref csiph.com linux.debian.user:247757

Show key headers only | View raw


On Fri, Apr 29, 2022 at 10:59:25PM -0600, William Torrez Corea wrote:
> > I get the following error:
> 
> cunit.c: In function ‘init_suite1’:
> cunit.c:39:10: warning: comparison between pointer and integer
>    39 |  if(NULL == (temp_file == fopen("temp.txt","w+"))){
>       |          ^~

The code you're tryhing to compile is not written correctly.  You'll
have to take this up with whoever wrote it.

In this particular line of code, my guess is the second == was supposed
to be = instead, to assign the result of fopen to the variable temp_file.

> In file included from /usr/include/CUnit/Basic.h:36,
>                  from cunit.c:30:
> cunit.c: In function ‘testFPRINTF’:
> cunit.c:68:37: warning: zero-length gnu_printf format string
> [-Wformat-zero-length]
>    68 |   CU_ASSERT(0 == fprintf(temp_file, ""));
>       |                                     ^~

I have no idea what this code is even trying to do.  "Simulate a write
but without any actual data, just to make sure the file descriptor
still exists"?!  Why would that even be a thing?

> cunit.c: At top level:
> cunit.c:75:31: warning: "/*" within comment [-Wcomment]
>    75 |  * Reads the data previously w/*
>       |

Funny.

> cunit.c:107:14: error: redefinition of ‘temp_file’
>   107 | static FILE* temp_file = NULL;
>       |              ^~~~~~~~~

This, I cannot diagnose without digging through the whole source tree.

Remainder snipped.  The debian-user mailing list is not the place to
get help fixing a broken C or C++ program.  Please take it up with
the author or maintainer.

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

CUnit - A Unit Testing Framework for C William Torrez Corea <willitc9888@gmail.com> - 2022-04-30 05:10 +0200
  Re: CUnit - A Unit Testing Framework for C Greg Wooledge <greg@wooledge.org> - 2022-04-30 05:20 +0200
    Re: CUnit - A Unit Testing Framework for C William Torrez Corea <willitc9888@gmail.com> - 2022-04-30 07:10 +0200
      Re: CUnit - A Unit Testing Framework for C Greg Wooledge <greg@wooledge.org> - 2022-04-30 13:40 +0200

csiph-web