summaryrefslogtreecommitdiff
path: root/cpp/test
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/test')
-rw-r--r--cpp/test/Freeze/complex/Complex.ice6
-rw-r--r--cpp/test/Freeze/complex/NodeI.h16
-rw-r--r--cpp/test/Slice/errorDetection/IdentAsKeyword.err3
-rw-r--r--cpp/test/Slice/errorDetection/IdentAsKeyword.ice4
-rw-r--r--cpp/test/Slice/errorDetection/Reserved.err15
-rw-r--r--cpp/test/Slice/errorDetection/Reserved.ice47
-rw-r--r--cpp/test/Slice/errorDetection/include/IcePrefix.ice11
-rwxr-xr-xcpp/test/Slice/errorDetection/run.py2
8 files changed, 92 insertions, 12 deletions
diff --git a/cpp/test/Freeze/complex/Complex.ice b/cpp/test/Freeze/complex/Complex.ice
index 35591d2fd25..70a507ba683 100644
--- a/cpp/test/Freeze/complex/Complex.ice
+++ b/cpp/test/Freeze/complex/Complex.ice
@@ -30,13 +30,13 @@ class Node {
class NumberNode extends Node
{
- int _number;
+ int number;
};
class BinaryNode extends Node
{
- Node _left;
- Node _right;
+ Node left;
+ Node right;
};
class AddNode extends BinaryNode
diff --git a/cpp/test/Freeze/complex/NodeI.h b/cpp/test/Freeze/complex/NodeI.h
index 0b9d0fa3dd5..328c5db7062 100644
--- a/cpp/test/Freeze/complex/NodeI.h
+++ b/cpp/test/Freeze/complex/NodeI.h
@@ -27,12 +27,12 @@ public:
NumberNodeI(int number)
{
- _number = number;
+ this->number = number;
}
virtual int calc(const Ice::Current&)
{
- return _number;
+ return number;
}
};
@@ -46,13 +46,13 @@ public:
AddNodeI(const NodePtr& left, const NodePtr& right)
{
- _left = left;
- _right = right;
+ this->left = left;
+ this->right = right;
}
virtual int calc(const Ice::Current&)
{
- return _left->calc() + _right->calc();
+ return left->calc() + right->calc();
}
};
@@ -66,13 +66,13 @@ public:
MultiplyNodeI(const NodePtr& left, const NodePtr& right)
{
- _left = left;
- _right = right;
+ this->left = left;
+ this->right = right;
}
virtual int calc(const Ice::Current&)
{
- return _left->calc() * _right->calc();
+ return left->calc() * right->calc();
}
};
diff --git a/cpp/test/Slice/errorDetection/IdentAsKeyword.err b/cpp/test/Slice/errorDetection/IdentAsKeyword.err
index 058922b7cab..d1558009ba6 100644
--- a/cpp/test/Slice/errorDetection/IdentAsKeyword.err
+++ b/cpp/test/Slice/errorDetection/IdentAsKeyword.err
@@ -84,3 +84,6 @@ IdentAsKeyword.ice:77: keyword `byte' cannot be used as parameter name
IdentAsKeyword.ice:79: keyword `byte' cannot be used as parameter name
IdentAsKeyword.ice:80: illegal identifier: `BYTE' differs from keyword `byte' only in capitalization
IdentAsKeyword.ice:80: keyword `byte' cannot be used as parameter name
+IdentAsKeyword.ice:84: illegal leading underscore for identifier `_a'
+IdentAsKeyword.ice:85: illegal leading underscore for identifier `_true'
+IdentAsKeyword.ice:86: illegal leading underscore for identifier `_true'
diff --git a/cpp/test/Slice/errorDetection/IdentAsKeyword.ice b/cpp/test/Slice/errorDetection/IdentAsKeyword.ice
index cd7b13d6c2a..0af740c836b 100644
--- a/cpp/test/Slice/errorDetection/IdentAsKeyword.ice
+++ b/cpp/test/Slice/errorDetection/IdentAsKeyword.ice
@@ -80,3 +80,7 @@ interface i9 { void op(out double byte); };
interface i10 { void op(out double BYTE); };
interface \true {}; // OK, escaped keyword
+
+interface _a; // Illegal leading underscore
+interface _true; // Illegal leading underscore
+interface \_true; // Illegal leading underscore
diff --git a/cpp/test/Slice/errorDetection/Reserved.err b/cpp/test/Slice/errorDetection/Reserved.err
new file mode 100644
index 00000000000..a78f24e8ba8
--- /dev/null
+++ b/cpp/test/Slice/errorDetection/Reserved.err
@@ -0,0 +1,15 @@
+Reserved.ice:31: illegal identifier `Prx': `Prx' suffix is reserved
+Reserved.ice:32: illegal identifier `abcPrx': `Prx' suffix is reserved
+Reserved.ice:33: illegal identifier `Ptr': `Ptr' suffix is reserved
+Reserved.ice:34: illegal identifier `abcPtr': `Ptr' suffix is reserved
+Reserved.ice:35: illegal identifier `Helper': `Helper' suffix is reserved
+Reserved.ice:36: illegal identifier `abcHelper': `Helper' suffix is reserved
+Reserved.ice:37: illegal identifier `Holder': `Holder' suffix is reserved
+Reserved.ice:38: illegal identifier `abcHolder': `Holder' suffix is reserved
+Reserved.ice:39: illegal identifier `Operations': `Operations' suffix is reserved
+Reserved.ice:40: illegal identifier `abcOperations': `Operations' suffix is reserved
+Reserved.ice:41: illegal identifier `Ice': `Ice' prefix is reserved
+Reserved.ice:42: illegal identifier `Iceblah': `Ice' prefix is reserved
+Reserved.ice:43: illegal identifier `IceFoo': `Ice' prefix is reserved
+Reserved.ice:46: illegal identifier `Ice': `Ice' prefix is reserved
+Reserved.ice:47: illegal identifier `IceFoo': `Ice' prefix is reserved
diff --git a/cpp/test/Slice/errorDetection/Reserved.ice b/cpp/test/Slice/errorDetection/Reserved.ice
new file mode 100644
index 00000000000..4560f79354f
--- /dev/null
+++ b/cpp/test/Slice/errorDetection/Reserved.ice
@@ -0,0 +1,47 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+#include <include/IcePrefix.ice> // No error should be caused by this file
+
+module OK
+{
+const long PrxA = 0;
+const long APrxA = 0;
+const long prxB = 0;
+const long Bprx = 0;
+const long prx = 0;
+const long PtrA = 0;
+const long HelperA = 0;
+const long HolderA = 0;
+const long OperationsA = 0;
+const long aIce = 0;
+const long ice = 0;
+const long icea = 0;
+};
+
+module errors
+{
+const long Prx = 0;
+const long abcPrx = 0;
+const long Ptr = 0;
+const long abcPtr = 0;
+const long Helper = 0;
+const long abcHelper = 0;
+const long Holder = 0;
+const long abcHolder = 0;
+const long Operations = 0;
+const long abcOperations = 0;
+const long Ice = 0;
+const long Iceblah = 0;
+const long IceFoo = 0;
+};
+
+module Ice {};
+module IceFoo {};
diff --git a/cpp/test/Slice/errorDetection/include/IcePrefix.ice b/cpp/test/Slice/errorDetection/include/IcePrefix.ice
new file mode 100644
index 00000000000..bfcd2357fe3
--- /dev/null
+++ b/cpp/test/Slice/errorDetection/include/IcePrefix.ice
@@ -0,0 +1,11 @@
+// **********************************************************************
+//
+// Copyright (c) 2001
+// Mutable Realms, Inc.
+// Huntsville, AL, USA
+//
+// All Rights Reserved
+//
+// **********************************************************************
+
+module IceSomething {};
diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py
index 0cc00280539..ee206bf5098 100755
--- a/cpp/test/Slice/errorDetection/run.py
+++ b/cpp/test/Slice/errorDetection/run.py
@@ -32,7 +32,7 @@ for file in files:
print file + "...",
- command = slice2cpp + " " + os.path.join(directory, file);
+ command = slice2cpp + " -I. " + os.path.join(directory, file);
stdin, stdout, stderr = os.popen3(command)
lines1 = stdout.readlines()
lines2 = open(os.path.join(directory, regex1.sub(".err", file)), "r").readlines()