root / htest / Test / Ganeti / Errors.hs @ 22381768
History | View | Annotate | Download (1.3 kB)
1 | ef3ad027 | Iustin Pop | {-# LANGUAGE TemplateHaskell #-} |
---|---|---|---|
2 | ef3ad027 | Iustin Pop | {-# OPTIONS_GHC -fno-warn-orphans #-} |
3 | ef3ad027 | Iustin Pop | |
4 | ef3ad027 | Iustin Pop | {-| Unittests for "Ganeti.Errors". |
5 | ef3ad027 | Iustin Pop | |
6 | ef3ad027 | Iustin Pop | -} |
7 | ef3ad027 | Iustin Pop | |
8 | ef3ad027 | Iustin Pop | {- |
9 | ef3ad027 | Iustin Pop | |
10 | ef3ad027 | Iustin Pop | Copyright (C) 2012 Google Inc. |
11 | ef3ad027 | Iustin Pop | |
12 | ef3ad027 | Iustin Pop | This program is free software; you can redistribute it and/or modify |
13 | ef3ad027 | Iustin Pop | it under the terms of the GNU General Public License as published by |
14 | ef3ad027 | Iustin Pop | the Free Software Foundation; either version 2 of the License, or |
15 | ef3ad027 | Iustin Pop | (at your option) any later version. |
16 | ef3ad027 | Iustin Pop | |
17 | ef3ad027 | Iustin Pop | This program is distributed in the hope that it will be useful, but |
18 | ef3ad027 | Iustin Pop | WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | ef3ad027 | Iustin Pop | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 | ef3ad027 | Iustin Pop | General Public License for more details. |
21 | ef3ad027 | Iustin Pop | |
22 | ef3ad027 | Iustin Pop | You should have received a copy of the GNU General Public License |
23 | ef3ad027 | Iustin Pop | along with this program; if not, write to the Free Software |
24 | ef3ad027 | Iustin Pop | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
25 | ef3ad027 | Iustin Pop | 02110-1301, USA. |
26 | ef3ad027 | Iustin Pop | |
27 | ef3ad027 | Iustin Pop | -} |
28 | ef3ad027 | Iustin Pop | |
29 | ef3ad027 | Iustin Pop | module Test.Ganeti.Errors (testErrors) where |
30 | ef3ad027 | Iustin Pop | |
31 | ef3ad027 | Iustin Pop | import Test.QuickCheck |
32 | ef3ad027 | Iustin Pop | |
33 | ef3ad027 | Iustin Pop | import Test.Ganeti.TestHelper |
34 | ef3ad027 | Iustin Pop | import Test.Ganeti.TestCommon |
35 | ef3ad027 | Iustin Pop | |
36 | ef3ad027 | Iustin Pop | import qualified Ganeti.Errors as Errors |
37 | ef3ad027 | Iustin Pop | |
38 | ef3ad027 | Iustin Pop | $(genArbitrary ''Errors.ErrorCode) |
39 | ef3ad027 | Iustin Pop | |
40 | ef3ad027 | Iustin Pop | $(genArbitrary ''Errors.GanetiException) |
41 | ef3ad027 | Iustin Pop | |
42 | ef3ad027 | Iustin Pop | -- | Tests error serialisation. |
43 | ef3ad027 | Iustin Pop | prop_GenericError_serialisation :: Errors.GanetiException -> Property |
44 | ef3ad027 | Iustin Pop | prop_GenericError_serialisation = testSerialisation |
45 | ef3ad027 | Iustin Pop | |
46 | ef3ad027 | Iustin Pop | testSuite "Errors" |
47 | ef3ad027 | Iustin Pop | [ 'prop_GenericError_serialisation |
48 | ef3ad027 | Iustin Pop | ] |