Commit 54e553ac authored by Robert Loehning's avatar Robert Loehning Committed by hjk

Tests: Add test for "using" keyword

Change-Id: I7c1563a69fe6f135a15eb86c1bcfe6b8050de193
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 7591fc71
......@@ -5240,6 +5240,8 @@ namespace basic {
namespace ns {
typedef unsigned long long vl;
typedef vl verylong;
using uvl = unsigned long long;
using usingverylong = uvl;
}
void testTypedef()
......@@ -5259,6 +5261,23 @@ namespace basic {
dummyStatement(&j, &k, &t1, &t2);
}
void testUsing()
{
using myType1 = quint32;
using myType2 = unsigned int;
myType1 t1 = 0;
myType2 t2 = 0;
ns::uvl j = 1000;
ns::usingverylong k = 1000;
BREAK_HERE;
// Check j 1000 basic::ns::uvl.
// Check k 1000 basic::ns::usingverylong.
// Check t1 0 basic::myType1.
// Check t2 0 basic::myType2.
// Continue.
dummyStatement(&j, &k, &t1, &t2);
}
void testStruct()
{
Foo f(2);
......@@ -5804,6 +5823,7 @@ namespace basic {
testFunction();
testAlphabeticSorting();
testTypedef();
testUsing();
testPointer();
testPointerTypedef();
testStruct();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment