Skip to content

Commit

Permalink
Add nested namespace tests
Browse files Browse the repository at this point in the history
Refs #768
  • Loading branch information
dbankieris committed Aug 1, 2024
1 parent 5990b30 commit dead37f
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/SIM_swig_template_scoping/models/Classes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,48 @@ namespace prime {
// prime::Onion::InnerOnion<bool> layer2;
// ::prime::Onion::InnerOnion<short> layer4;
};

// Same tests as above, but within a nested namespace.
namespace nested {
class Corn {
::Foo<peer::Leek> fooLeek;

peer::Bar<Foo<long>> barFoo;
::peer::Bar<peer::Leek> barLeek;

peer::Leek::Eggplant<long> eggplantLong;
::peer::Leek::Eggplant<peer::Leek> eggplantLeek;

peer::nested::Broccoli<long> broccoliLong;
::peer::nested::Broccoli<peer::Leek> broccoliLeek;

peer::nested::Carrot::Celery<long> celeryLong;
::peer::nested::Carrot::Celery<peer::Leek> celeryLeek;

prime::Potato<long> potatoLong;
::prime::Potato<peer::Leek> potatoLeek;

prime::Turnip::Radish<long> radishLong;
::prime::Turnip::Radish<peer::Leek> radishLeek;

prime::nested::Baz<long> bazLong;
::prime::nested::Baz<peer::Leek> bazLeek;

prime::nested::Artichoke::Asparagus<long> asparagusLong;
::prime::nested::Artichoke::Asparagus<peer::Leek> asparagusLeek;

// These fail in Onion, but work here because Onion has already been processed.
prime::Onion::InnerOnion<long> onionLong;
::prime::Onion::InnerOnion<peer::Leek> onionLeek;

// These fail for the same reason as in Onion.
// Foo<float> fooFloat;
// Turnip::Radish<float> radishFloat;
// nested::Baz<float> bazFloat;
// nested::Artichoke::Asparagus<float> asparagusFloat;
// Onion::InnerOnion<float> innerOnionFloat;
};
}
}

#endif

0 comments on commit dead37f

Please sign in to comment.