replace #define with constrexpr for better compiler error reports on integer constants

This commit is contained in:
Axel Kohlmeyer
2021-08-17 09:42:08 -04:00
parent f24054f7b3
commit 0dbcb5dd66
2 changed files with 9 additions and 12 deletions

View File

@ -74,7 +74,8 @@ protected:
}
};
#define MAX_BUF_SIZE 128
static constexpr int MAX_BUF_SIZE=128;
TEST_F(FileOperationsTest, safe_fgets)
{
char buf[MAX_BUF_SIZE];
@ -110,7 +111,6 @@ TEST_F(FileOperationsTest, safe_fgets)
fclose(fp);
}
#define MAX_BUF_SIZE 128
TEST_F(FileOperationsTest, fgets_trunc)
{
char buf[MAX_BUF_SIZE];
@ -174,7 +174,6 @@ TEST_F(FileOperationsTest, fgets_trunc)
fclose(fp);
}
#define MAX_BUF_SIZE 128
TEST_F(FileOperationsTest, safe_fread)
{
char buf[MAX_BUF_SIZE];