~jkakar/ion/avoid-name-collisions

« back to all changes in this revision

Viewing changes to framework-tests/AbstractExceptionTest.h

  • Committer: Jamshed Kakar
  • Date: 2007-01-08 00:45:26 UTC
  • mfrom: (17.1.5 release-0.2)
  • Revision ID: jkakar@pedro-20070108004526-5079fe9934e16d67
- Merged 57186-release-0.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
    
125
125
    template <typename Exception>
126
126
    void
 
127
    AbstractExceptionTest<Exception>::set_up()
 
128
    {
 
129
        error_exception_ = new Exception(EINVAL);
 
130
        error_location_exception_ = new Exception(EAGAIN, "exception.cpp", 1);
 
131
        message_exception_ = new Exception("Sample message.");
 
132
        message_location_exception_ = new Exception("Sample message.",
 
133
                                                    "exception.cpp", 2);
 
134
    }
 
135
    
 
136
    template <typename Exception>
 
137
    void
 
138
    AbstractExceptionTest<Exception>::tear_down()
 
139
    {
 
140
        delete error_exception_;
 
141
        delete error_location_exception_;
 
142
        delete message_exception_;
 
143
        delete message_location_exception_;
 
144
    }
 
145
    
 
146
    template <typename Exception>
 
147
    void
 
148
    AbstractExceptionTest<Exception>::throw_exception()
 
149
        throw(Exception)
 
150
    {
 
151
        FRAMEWORK_THROW(Exception, "Sample message.");
 
152
    }
 
153
 
 
154
    template <typename Exception>
 
155
    void
127
156
    AbstractExceptionTest<Exception>::error_number()
128
157
    {
129
158
        ASSERT_ERROR(error_exception_->error_number() == EINVAL);
134
163
    void
135
164
    AbstractExceptionTest<Exception>::function()
136
165
    {
137
 
        ASSERT_ERROR(error_location_exception_->function() == "exception.cc");
 
166
        ASSERT_ERROR(error_location_exception_->function() == "exception.cpp");
138
167
        ASSERT_ERROR(message_location_exception_->function()
139
 
                     == "exception.cc");
 
168
                     == "exception.cpp");
140
169
    }
141
170
    
142
171
    template <typename Exception>
158
187
    
159
188
    template <typename Exception>
160
189
    void
161
 
    AbstractExceptionTest<Exception>::set_up()
162
 
    {
163
 
        error_exception_ = new Exception(EINVAL);
164
 
        error_location_exception_ = new Exception(EAGAIN, "exception.cc", 1);
165
 
        message_exception_ = new Exception("Sample message.");
166
 
        message_location_exception_ = new Exception("Sample message.",
167
 
                                                    "exception.cc", 2);
168
 
    }
169
 
    
170
 
    template <typename Exception>
171
 
    void
172
190
    AbstractExceptionTest<Exception>::stack_trace()
173
191
    {
174
192
        framework::StackTraceEnabler generate_stack_traces;
182
200
            ASSERT_ERROR(exception.stack_trace() != "");
183
201
        }
184
202
    }
185
 
    
186
 
    template <typename Exception>
187
 
    void
188
 
    AbstractExceptionTest<Exception>::tear_down()
189
 
    {
190
 
        delete error_exception_;
191
 
        delete error_location_exception_;
192
 
        delete message_exception_;
193
 
        delete message_location_exception_;
194
 
    }
195
 
    
196
 
    template <typename Exception>
197
 
    void
198
 
    AbstractExceptionTest<Exception>::throw_exception()
199
 
        throw(Exception)
200
 
    {
201
 
        FRAMEWORK_THROW(Exception, "Sample message.");
202
 
    }
203
203
} // namespace framework_tests
204
204
 
205
205
#endif // FRAMEWORK_TESTS_ABSTRACTEXCEPTIONTEST_H