summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/test/Ice/defaultValue/AllTests.cpp42
-rw-r--r--cpp/test/Ice/defaultValue/Test.ice36
2 files changed, 78 insertions, 0 deletions
diff --git a/cpp/test/Ice/defaultValue/AllTests.cpp b/cpp/test/Ice/defaultValue/AllTests.cpp
index 29b34ea7586..3ccc4799b19 100644
--- a/cpp/test/Ice/defaultValue/AllTests.cpp
+++ b/cpp/test/Ice/defaultValue/AllTests.cpp
@@ -37,6 +37,12 @@ allTests()
test(v.nc2 == Nested::green);
test(v.nc3 == Nested::blue);
test(v.noDefault.empty());
+ test(v.zeroI == 0);
+ test(v.zeroL == 0);
+ test(v.zeroF == 0);
+ test(v.zeroDotF == 0);
+ test(v.zeroD == 0);
+ test(v.zeroDotD == 0);
}
{
@@ -55,6 +61,12 @@ allTests()
test(v.nc1 == ConstNestedColor1);
test(v.nc2 == ConstNestedColor2);
test(v.nc3 == ConstNestedColor3);
+ test(v.zeroI == ConstZeroI);
+ test(v.zeroL == ConstZeroL);
+ test(v.zeroF == ConstZeroF);
+ test(v.zeroDotF == ConstZeroDotF);
+ test(v.zeroD == ConstZeroD);
+ test(v.zeroDotD == ConstZeroDotD);
}
{
@@ -75,6 +87,12 @@ allTests()
test(v->nc2 == Nested::green);
test(v->nc3 == Nested::blue);
test(v->noDefault.empty());
+ test(v->zeroI == 0);
+ test(v->zeroL == 0);
+ test(v->zeroF == 0);
+ test(v->zeroDotF == 0);
+ test(v->zeroD == 0);
+ test(v->zeroDotD == 0);
}
{
@@ -89,6 +107,12 @@ allTests()
test(v->d == 6.2);
test(v->str == "foo \\ \"bar\n \r\n\t\v\f\a\b? \007 \x07");
test(v->noDefault.empty());
+ test(v->zeroI == 0);
+ test(v->zeroL == 0);
+ test(v->zeroF == 0);
+ test(v->zeroDotF == 0);
+ test(v->zeroD == 0);
+ test(v->zeroDotD == 0);
}
{
@@ -109,6 +133,12 @@ allTests()
test(v->nc1 == Nested::red);
test(v->nc2 == Nested::green);
test(v->nc3 == Nested::blue);
+ test(v->zeroI == 0);
+ test(v->zeroL == 0);
+ test(v->zeroF == 0);
+ test(v->zeroDotF == 0);
+ test(v->zeroD == 0);
+ test(v->zeroDotD == 0);
}
{
@@ -123,6 +153,12 @@ allTests()
test(v.d == 6.2);
test(v.str == "foo \\ \"bar\n \r\n\t\v\f\a\b? \007 \x07");
test(v.noDefault.empty());
+ test(v.zeroI == 0);
+ test(v.zeroL == 0);
+ test(v.zeroF == 0);
+ test(v.zeroDotF == 0);
+ test(v.zeroD == 0);
+ test(v.zeroDotD == 0);
}
{
@@ -143,6 +179,12 @@ allTests()
test(v.nc1 == Nested::red);
test(v.nc2 == Nested::green);
test(v.nc3 == Nested::blue);
+ test(v.zeroI == 0);
+ test(v.zeroL == 0);
+ test(v.zeroF == 0);
+ test(v.zeroDotF == 0);
+ test(v.zeroD == 0);
+ test(v.zeroDotD == 0);
}
cout << "ok" << endl;
diff --git a/cpp/test/Ice/defaultValue/Test.ice b/cpp/test/Ice/defaultValue/Test.ice
index 0c63d44533c..3e737d93856 100644
--- a/cpp/test/Ice/defaultValue/Test.ice
+++ b/cpp/test/Ice/defaultValue/Test.ice
@@ -40,6 +40,12 @@ struct Struct1
Nested::Color nc2 = Nested::green;
Nested::Color nc3 = Nested::blue;
string noDefault;
+ int zeroI = 0;
+ long zeroL = 0;
+ float zeroF = 0;
+ float zeroDotF = 0.0;
+ double zeroD = 0;
+ double zeroDotD = 0;
};
const bool ConstBool = true;
@@ -56,6 +62,12 @@ const Color ConstColor3 = blue;
const Nested::Color ConstNestedColor1 = ::Test::Nested::red;
const Nested::Color ConstNestedColor2 = Test::Nested::green;
const Nested::Color ConstNestedColor3 = Nested::blue;
+const int ConstZeroI = 0;
+const long ConstZeroL = 0;
+const float ConstZeroF = 0;
+const float ConstZeroDotF = 0.0;
+const double ConstZeroD = 0;
+const double ConstZeroDotD = 0;
struct Struct2
{
@@ -73,6 +85,12 @@ struct Struct2
Nested::Color nc1 = ConstNestedColor1;
Nested::Color nc2 = ConstNestedColor2;
Nested::Color nc3 = ConstNestedColor3;
+ int zeroI = ConstZeroI;
+ long zeroL = ConstZeroL;
+ float zeroF = ConstZeroF;
+ float zeroDotF = ConstZeroDotF;
+ double zeroD = ConstZeroD;
+ double zeroDotD = ConstZeroDotD;
};
["cpp:class"]
@@ -94,6 +112,12 @@ struct Struct3
Nested::Color nc2 = Nested::green;
Nested::Color nc3 = Nested::blue;
string noDefault;
+ int zeroI = 0;
+ long zeroL = 0;
+ float zeroF = 0;
+ float zeroDotF = 0.0;
+ double zeroD = 0;
+ double zeroDotD = 0;
};
class Base
@@ -108,6 +132,12 @@ class Base
double d = 6.2;
string str = "foo \\ \"bar\n \r\n\t\v\f\a\b\? \007 \x07";
string noDefault;
+ int zeroI = 0;
+ long zeroL = 0;
+ float zeroF = 0;
+ float zeroDotF = 0.0;
+ double zeroD = 0;
+ double zeroDotD = 0;
};
class Derived extends Base
@@ -132,6 +162,12 @@ exception BaseEx
double d = 6.2;
string str = "foo \\ \"bar\n \r\n\t\v\f\a\b\? \007 \x07";
string noDefault;
+ int zeroI = 0;
+ long zeroL = 0;
+ float zeroF = 0;
+ float zeroDotF = 0.0;
+ double zeroD = 0;
+ double zeroDotD = 0;
};
exception DerivedEx extends BaseEx