~ubuntu-branches/ubuntu/quantal/aspectc++/quantal

« back to all changes in this revision

Viewing changes to AspectC++/tests/Bug336/main.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <iostream>
 
2
 
 
3
#define FAILING
 
4
 
 
5
struct test {
 
6
    int field0;
 
7
};
 
8
 
 
9
#ifndef FAILING
 
10
    test teststruct = {0, 1, 2, 3};
 
11
#else
 
12
    test teststruct = {0, 1, 3};
 
13
#endif
 
14
 
 
15
int main () {
 
16
 
 
17
  std::cout << "Bug 336: wrong ordering if order advice has no match:" << std::endl;
 
18
  std::cout << "=====================================================" << std::endl;
 
19
  std::cout << "the result should be 031 ..." << std::endl;
 
20
#ifndef FAILING
 
21
    std::cout << teststruct.field0 << teststruct.field1 << teststruct.field2 << 
 
22
teststruct.field3 << std::endl;
 
23
    // returns 0321
 
24
#else
 
25
    std::cout << teststruct.field0 << teststruct.field1 << teststruct.field3 << 
 
26
std::endl;
 
27
    // should return 031,
 
28
    // but returns 013 (as if order advice was not given)
 
29
#endif
 
30
  std::cout << "=====================================================" << std::endl;
 
31
 
 
32
    return 0;
 
33
}
 
34
 
 
35
aspect orderaspect {
 
36
    advice "test" : order ("slice3", "slice2", "slice1");
 
37
};
 
38
 
 
39
aspect slice1 {
 
40
    advice "test" : slice struct {
 
41
        int field1;
 
42
    };
 
43
};
 
44
 
 
45
#ifndef FAILING
 
46
aspect slice2 {
 
47
    advice "test" : slice struct {
 
48
        int field2;
 
49
    };
 
50
};
 
51
#endif
 
52
 
 
53
aspect slice3 {
 
54
    advice "test" : slice struct {
 
55
        int field3;
 
56
    };
 
57
};