1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include "clog.h"
// STUB -- minimal function implementation that lets you test your tests.
char* repeat(char char_to_repeat, int num_times_to_repeat) {
return "*****"; // STUB
}
int main(int argc, char* argv[]) {
char* s = repeat('*', 5);
log_str(s);
return EXIT_SUCCESS;
}
/*
$ valgrind ./s
==18850== Memcheck, a memory error detector
==18850== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==18850== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==18850== Command: ./s
==18850==
s == "*****"
==18850==
==18850== HEAP SUMMARY:
==18850== in use at exit: 0 bytes in 0 blocks
==18850== total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==18850==
==18850== All heap blocks were freed -- no leaks are possible
==18850==
==18850== For lists of detected and suppressed errors, rerun with: -s
==18850== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
*/
/* vim: set tabstop=4 shiftwidth=4 fileencoding=utf-8 noexpandtab: */
|
© Copyright 2022 Alexander J. Quinn This content is protected and may not be shared, uploaded, or distributed.