Skip to content

Commit 89e39c5

Browse files
committed
Temp. hide expected warnings, correct constant
1 parent 391a44a commit 89e39c5

7 files changed

Lines changed: 92 additions & 2 deletions

test/xarray_test.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
// License: BSD
77
//----------------------------------------------------------------------------------
88

9+
// Disable warnings from template instantiations in header files
10+
#ifdef __GNUC__
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wunused-parameter"
13+
#pragma GCC diagnostic ignored "-Wnonnull"
14+
#endif
15+
916
#include "xnode.h"
1017
#include "xarray.h"
1118
#include <iostream>
@@ -25,6 +32,11 @@
2532
#include "cunit.h"
2633
#include "xobject.h"
2734

35+
// Restore warnings after includes
36+
#ifdef __GNUC__
37+
#pragma GCC diagnostic pop
38+
#endif
39+
2840
using namespace std;
2941

3042
void TestArraySum() {

test/xnode_convert_test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
// License: BSD
77
//----------------------------------------------------------------------------------
88

9+
// Disable warnings from template instantiations in header files
10+
#ifdef __GNUC__
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wunused-parameter"
13+
#pragma GCC diagnostic ignored "-Wunused-variable"
14+
#pragma GCC diagnostic ignored "-Wnonnull"
15+
#endif
16+
917
#include "xnode.h"
1018
#include <iostream>
1119

@@ -18,6 +26,11 @@
1826
#include <limits>
1927
#include <cmath>
2028

29+
// Restore warnings after includes
30+
#ifdef __GNUC__
31+
#pragma GCC diagnostic pop
32+
#endif
33+
2134
using namespace std;
2235

2336
// Helper function to log the conversion being tested

test/xnode_overflow_test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
// License: BSD
77
//----------------------------------------------------------------------------------
88

9+
// Disable warnings from template instantiations in header files
10+
#ifdef __GNUC__
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wunused-parameter"
13+
#pragma GCC diagnostic ignored "-Wunused-variable"
14+
#pragma GCC diagnostic ignored "-Wnonnull"
15+
#endif
16+
917
#include "xnode.h"
1018
#include <iostream>
1119
#include <limits>
@@ -16,6 +24,11 @@
1624
#include "cunit.h"
1725
#include "xarray.h"
1826

27+
// Restore warnings after includes
28+
#ifdef __GNUC__
29+
#pragma GCC diagnostic pop
30+
#endif
31+
1932
using namespace std;
2033

2134
// Helper function to log the test being executed

test/xnode_test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
// License: BSD
88
//----------------------------------------------------------------------------------
99

10+
// Disable warnings from template instantiations in header files
11+
#ifdef __GNUC__
12+
#pragma GCC diagnostic push
13+
#pragma GCC diagnostic ignored "-Wunused-parameter"
14+
#pragma GCC diagnostic ignored "-Wunused-variable"
15+
#pragma GCC diagnostic ignored "-Wnonnull"
16+
#endif
17+
1018
#include "xnode.h"
1119
#include <iostream>
1220

@@ -19,6 +27,11 @@
1927
#include "cunit.h"
2028
#include "xnode_long_double.h"
2129

30+
// Restore warnings after includes
31+
#ifdef __GNUC__
32+
#pragma GCC diagnostic pop
33+
#endif
34+
2235
using namespace std;
2336

2437
void TestDefCntr() {

test/xnode_tree_test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
// License: BSD
77
//----------------------------------------------------------------------------------
88

9+
// Disable warnings from template instantiations in header files
10+
#ifdef __GNUC__
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wunused-parameter"
13+
#pragma GCC diagnostic ignored "-Wunused-variable"
14+
#pragma GCC diagnostic ignored "-Wnonnull"
15+
#endif
16+
917
#include "xnode.h"
1018
#include "xarray.h"
1119
#include "xobject.h"
@@ -16,6 +24,11 @@
1624

1725
#include "cunit.h"
1826

27+
// Restore warnings after includes
28+
#ifdef __GNUC__
29+
#pragma GCC diagnostic pop
30+
#endif
31+
1932
using namespace std;
2033

2134
void TestTreeOfNodesWithArray() {

test/xnode_type_test.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,25 @@
66
// License: BSD
77
//----------------------------------------------------------------------------------
88

9+
// Disable warnings from template instantiations in header files
10+
#ifdef __GNUC__
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wunused-parameter"
13+
#pragma GCC diagnostic ignored "-Wunused-variable"
14+
#pragma GCC diagnostic ignored "-Wnonnull"
15+
#endif
16+
917
#include "xnode.h"
1018
#include <iostream>
1119
#include "cunit.h"
1220
#include <limits>
1321
#include <cmath>
1422

23+
// Restore warnings after includes
24+
#ifdef __GNUC__
25+
#pragma GCC diagnostic pop
26+
#endif
27+
1528
using namespace std;
1629

1730
// Test functions for each supported data type
@@ -272,14 +285,14 @@ void TestLongType() {
272285
void TestLongLongType() {
273286
// Test scenario 1
274287
xnode node;
275-
long long testValue = 1234567890123456789LL;
288+
long long testValue = std::numeric_limits<long long>::max();
276289
node.set_as<long long>(testValue);
277290

278291
AssertTrue(node.is<long long>(), "is<long long>() should return true");
279292
AssertEquals(testValue, node.get_as<long long>(), "get_as<long long>() should return the test value");
280293

281294
// Test with negative value
282-
long long negValue = -9876543210987654321LL;
295+
long long negValue = std::numeric_limits<long long>::min();
283296
node.set_as<long long>(negValue);
284297

285298
AssertTrue(node.is<long long>(), "is<long long>() should return true for negative value");

test/xobject_test.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
// License: BSD
77
//----------------------------------------------------------------------------------
88

9+
// Disable warnings from template instantiations in header files
10+
#ifdef __GNUC__
11+
#pragma GCC diagnostic push
12+
#pragma GCC diagnostic ignored "-Wunused-parameter"
13+
#pragma GCC diagnostic ignored "-Wunused-variable"
14+
#pragma GCC diagnostic ignored "-Wnonnull"
15+
#endif
16+
917
#include "xnode.h"
1018
#include "xobject.h"
1119
#include <iostream>
@@ -14,6 +22,11 @@
1422

1523
#include "cunit.h"
1624

25+
// Restore warnings after includes
26+
#ifdef __GNUC__
27+
#pragma GCC diagnostic pop
28+
#endif
29+
1730
using namespace std;
1831

1932
void TestPropertyListPutGet() {

0 commit comments

Comments
 (0)