@@ -26,82 +26,76 @@ template <> struct Helper<BufferExtents> {
26
26
return make_unique<BufferExtents>(1 );
27
27
}
28
28
29
- static constexpr char Expected[] = " <Buffer: size = 1 bytes>" ;
29
+ static const char * expected () { return " <Buffer: size = 1 bytes>" ; }
30
30
};
31
- const char Helper<BufferExtents>::Expected[];
32
31
33
32
template <> struct Helper <WallclockRecord> {
34
33
static std::unique_ptr<Record> construct () {
35
34
return make_unique<WallclockRecord>(1 , 2 );
36
35
}
37
36
38
- static constexpr char Expected[] = " <Wall Time: seconds = 1.000002>" ;
37
+ static const char * expected () { return " <Wall Time: seconds = 1.000002>" ; }
39
38
};
40
- const char Helper<WallclockRecord>::Expected[];
41
39
42
40
template <> struct Helper <NewCPUIDRecord> {
43
41
static std::unique_ptr<Record> construct () {
44
42
return make_unique<NewCPUIDRecord>(1 );
45
43
}
46
44
47
- static constexpr char Expected[] = " <CPU ID: 1>" ;
45
+ static const char * expected () { return " <CPU ID: 1>" ; }
48
46
};
49
- const char Helper<NewCPUIDRecord>::Expected[];
50
47
51
48
template <> struct Helper <TSCWrapRecord> {
52
49
static std::unique_ptr<Record> construct () {
53
50
return make_unique<TSCWrapRecord>(1 );
54
51
}
55
52
56
- static constexpr char Expected[] = " <TSC Wrap: base = 1>" ;
53
+ static const char * expected () { return " <TSC Wrap: base = 1>" ; }
57
54
};
58
- const char Helper<TSCWrapRecord>::Expected[];
59
55
60
56
template <> struct Helper <CustomEventRecord> {
61
57
static std::unique_ptr<Record> construct () {
62
58
return make_unique<CustomEventRecord>(4 , 1 , " data" );
63
59
}
64
60
65
- static constexpr char Expected[] =
66
- " <Custom Event: tsc = 1, size = 4, data = 'data'>" ;
61
+ static const char *expected () {
62
+ return " <Custom Event: tsc = 1, size = 4, data = 'data'>" ;
63
+ }
67
64
};
68
- const char Helper<CustomEventRecord>::Expected[];
69
65
70
66
template <> struct Helper <CallArgRecord> {
71
67
static std::unique_ptr<Record> construct () {
72
68
return make_unique<CallArgRecord>(1 );
73
69
}
74
70
75
- static constexpr char Expected[] = " <Call Argument: data = 1 (hex = 0x1)>" ;
71
+ static const char *expected () {
72
+ return " <Call Argument: data = 1 (hex = 0x1)>" ;
73
+ }
76
74
};
77
- const char Helper<CallArgRecord>::Expected[];
78
75
79
76
template <> struct Helper <PIDRecord> {
80
77
static std::unique_ptr<Record> construct () {
81
78
return make_unique<PIDRecord>(1 );
82
79
}
83
80
84
- static constexpr char Expected[] = " <PID: 1>" ;
81
+ static const char * expected () { return " <PID: 1>" ; }
85
82
};
86
- const char Helper<PIDRecord>::Expected[];
87
83
88
84
template <> struct Helper <NewBufferRecord> {
89
85
static std::unique_ptr<Record> construct () {
90
86
return make_unique<NewBufferRecord>(1 );
91
87
}
92
88
93
- static constexpr char Expected[] = " <Thread ID: 1>" ;
89
+ static const char * expected () { return " <Thread ID: 1>" ; }
94
90
};
95
- const char Helper<NewBufferRecord>::Expected[];
96
91
97
92
template <> struct Helper <EndBufferRecord> {
98
93
static std::unique_ptr<Record> construct () {
99
94
return make_unique<EndBufferRecord>();
100
95
}
101
96
102
- static constexpr char Expected[] = " <End of Buffer>" ;
97
+ static const char * expected () { return " <End of Buffer>" ; }
103
98
};
104
- const char Helper<EndBufferRecord>::Expected[];
105
99
106
100
template <class T > class PrinterTest : public ::testing::Test {
107
101
protected:
@@ -120,7 +114,7 @@ TYPED_TEST_P(PrinterTest, PrintsRecord) {
120
114
ASSERT_NE (nullptr , this ->R );
121
115
ASSERT_FALSE (errorToBool (this ->R ->apply (this ->P )));
122
116
this ->OS .flush ();
123
- EXPECT_THAT (this ->Data , Eq (Helper<TypeParam>::Expected ));
117
+ EXPECT_THAT (this ->Data , Eq (Helper<TypeParam>::expected () ));
124
118
}
125
119
126
120
REGISTER_TYPED_TEST_CASE_P (PrinterTest, PrintsRecord);
0 commit comments