Skip to content

Commit a81878e

Browse files
committed
Put the macro where it should've been in the first place
1 parent 3d68740 commit a81878e

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

tests/common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ int ecc_key_cmp(const int should_type, const ecc_key *should, const ecc_key *is)
4040

4141
#define COMPARE_TESTVECTOR(i, il, s, sl, wa, wi) do { DO(ltc_do_compare_testvector((i), (il), (s), (sl), (wa), (wi))); } while(0)
4242

43+
#ifdef CMAKE_SOURCE_DIR
44+
#define FILE_IN_SOURCE_DIR(f) CMAKE_SOURCE_DIR "/" f
45+
#else
46+
#define FILE_IN_SOURCE_DIR(f) f
47+
#endif
48+
4349
#if !((defined(_WIN32) || defined(_WIN32_WCE)) && !defined(__GNUC__)) && !defined(LTC_NO_FILE)
4450
#define LTC_TEST_READDIR
4551

tests/file_test.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ int file_test(void)
1313
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F };
1414
unsigned char buf[200];
1515
unsigned long len;
16-
#ifdef CMAKE_SOURCE_DIR
17-
#define FILE_IN_SOURCE_DIR(f) CMAKE_SOURCE_DIR "/" f
18-
#else
19-
#define FILE_IN_SOURCE_DIR(f) f
20-
#endif
2116
const char *fname = FILE_IN_SOURCE_DIR("tests/test.key");
2217
FILE *in;
2318
int err, isha256, iaes;

tests/x509_test.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
/* SPDX-License-Identifier: Unlicense */
33
#include <tomcrypt_test.h>
44

5-
#ifdef CMAKE_SOURCE_DIR
6-
#define FILE_IN_SOURCE_DIR(f) CMAKE_SOURCE_DIR "/" f
7-
#else
8-
#define FILE_IN_SOURCE_DIR(f) f
9-
#endif
10-
115
#if defined(LTC_PEM) && defined(LTC_TEST_READDIR) && !defined(LTC_EASY)
126

137
static int s_x509_decode(const void *in, unsigned long inlen, void *cert)

0 commit comments

Comments
 (0)