summaryrefslogtreecommitdiffstats
path: root/src/util/tests/string_buffer
diff options
context:
space:
mode:
authorThomas Helland <[email protected]>2017-09-27 21:24:06 +0200
committerThomas Helland <[email protected]>2017-09-28 23:22:07 +0200
commitce09364d4ec527ceee5be8bf4a08fb27cd2bf152 (patch)
tree92f4bdccc66424b4494a9a478ad33d43bee7ba81 /src/util/tests/string_buffer
parenta35f25068ac71d8f986807cd5fa59e0e7a1ad34d (diff)
util: fix in-class initialization of static member
Fix a compile error with G++ 4.4 string_buffer_test.cpp:43: error: ISO C++ forbids initialization of member ‘str1’ string_buffer_test.cpp:43: error: making ‘str1’ static string_buffer_test.cpp:43: error: invalid in-class initialization of static data member of non-integral type ‘const char*’ Tested-by: Vinson Lee <vlee at freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103002
Diffstat (limited to 'src/util/tests/string_buffer')
-rw-r--r--src/util/tests/string_buffer/string_buffer_test.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/util/tests/string_buffer/string_buffer_test.cpp b/src/util/tests/string_buffer/string_buffer_test.cpp
index c3d43cb67b5..545f607fadd 100644
--- a/src/util/tests/string_buffer/string_buffer_test.cpp
+++ b/src/util/tests/string_buffer/string_buffer_test.cpp
@@ -40,9 +40,9 @@ class string_buffer : public ::testing::Test {
public:
struct _mesa_string_buffer *buf;
- const char *str1 = "test1";
- const char *str2 = "test2";
- const char *str3 = "test1test2";
+ const char *str1;
+ const char *str2;
+ const char *str3;
char str4[80];
char str5[40];
@@ -53,6 +53,9 @@ public:
void
string_buffer::SetUp()
{
+ str1 = "test1";
+ str2 = "test2";
+ str3 = "test1test2";
buf = _mesa_string_buffer_create(NULL, INITIAL_BUF_SIZE);
}