implemented logFlags-related stuff in logger-test

This commit is contained in:
Václav Šmejkal 2022-12-09 17:50:14 +01:00
parent f04cfb8ad4
commit 799fc752b2
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -27,8 +27,21 @@ int main(void)
logFile logger = initLogger(WRITE_DIR); //INITIALIZE LOGGER FILE logFile logger = initLogger(WRITE_DIR); //INITIALIZE LOGGER FILE
int bufferSize; int bufferSize;
char *buffer; char *buffer;
char *usedKey = malloc(getKeyLength() + 1);
FILE *fileBuffer; FILE *fileBuffer;
//GENERATE KEY
generateKey(usedKey, getKeyLength());
//FLAGS
logFlags flags =
{
usedKey
};
//SET FLAGS
setLogFlags(flags);
writeLog(logger.file, WRITE_MESSAGE); //WRITE writeLog(logger.file, WRITE_MESSAGE); //WRITE
fileBuffer = fopen(logger.fileName, "r"); fileBuffer = fopen(logger.fileName, "r");
@ -46,6 +59,7 @@ int main(void)
//DEALLOCATION //DEALLOCATION
free(buffer); free(buffer);
free(usedKey);
fclose(fileBuffer); fclose(fileBuffer);
deallocateLogger(logger); deallocateLogger(logger);
return 0; return 0;