Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

CTests ctest.h has code that is not platform-agnostic. Also ctest sources use fopen() calls. Needs to be reworked.

Aperta
#222 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@gapisback ci sta già lavorando.

Dal 25/1/2022.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

This item was recognized during review of PR #212 by Alex. The points noted are:

One issue that you foresaw is that ctest.h doesn't adhere to our platform rules. I think that's out of scope, but we should open an issue and fix that.

About this chunk of code (which was inline in the .c code but macro'ized as a result of a review comment):

267 #define vfprintf_usermsg(fh, message)                \
268     do {                                            \
269         va_list varargs;                            \
270         va_start(varargs, message);                 \
271         vfprintf((fh), (message), varargs);           \
272         va_end(varargs);                            \
273     } while (0)
274

... the remark was: There is platform_error_log for this and I believe a way to specify the handle as well.
Revisit whether the call to vfprintf() on L271 can be changed to use platform_error_log() as suggested.

I want to note that this file is not platform-agnostic as is. Specifically, it uses some stuff that doesn't fly on certain platforms on which Splinter is also ported:

#include <inttypes.h> /* intmax_t, uintmax_t, PRI* /
#include <stddef.h> /
size_t */
That seems straightforward to change using our platform definitions and some sed. This is the only ctest code file, right? We should open an issue and audit this. We have a special poison.h header to check for compliance.

A similar issue recognized during review of PR #224 is the following usages of fopen(), that is now being seen commonly in all unit-test sources:

108 // clang-format off
109 CTEST_SETUP(splinter)
110 {
111    Platform_stdout_fh = fopen("/tmp/unit_test.stdout", "a+");
112    Platform_stderr_fh = fopen("/tmp/unit_test.stderr", "a+");
113

Such references to fopen() should be platform'ized, so we don't run the risk that such code will not link on platforms where this stdlib function may not be available.

Lingua principale
C
Stelle
733
Fork
68
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vmware/splinterdb

Tutte le issue di vmware/splinterdb

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.