Fix tests path.

This commit is contained in:
2021-10-05 04:38:55 +01:00
parent fe8e157f89
commit 15fdd85481
9 changed files with 67 additions and 11 deletions

View File

@@ -2,10 +2,11 @@
// Created by claunia on 5/10/21.
//
#include <climits>
#include <cstdint>
#include "../crc16_ccitt.h"
#include "../library.h"
#include "../crc16_ccitt.h"
#include "gtest/gtest.h"
#define EXPECTED_CRC16_CCITT 0x3640
@@ -24,7 +25,13 @@ class crc16_ccittFixture : public ::testing::Test
protected:
void SetUp()
{
FILE* file = fopen("/home/claunia/random", "rb");
char path[PATH_MAX];
char filename[PATH_MAX];
getcwd(path, PATH_MAX);
snprintf(filename, PATH_MAX, "%s/data/random", path);
FILE* file = fopen(filename, "rb");
buffer = (const uint8_t*)malloc(1048576);
fread((void*)buffer, 1, 1048576, file);
fclose(file);