Revision 72747d91 test/hs/Test/Ganeti/JQueue.hs
b/test/hs/Test/Ganeti/JQueue.hs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
{- |
8 | 8 |
|
9 |
Copyright (C) 2012 Google Inc. |
|
9 |
Copyright (C) 2012, 2013 Google Inc.
|
|
10 | 10 |
|
11 | 11 |
This program is free software; you can redistribute it and/or modify |
12 | 12 |
it under the terms of the GNU General Public License as published by |
... | ... | |
135 | 135 |
case_JobStatusPri_py_equiv :: Assertion |
136 | 136 |
case_JobStatusPri_py_equiv = do |
137 | 137 |
let num_jobs = 2000::Int |
138 |
sample_jobs <- sample' (vectorOf num_jobs $ do |
|
139 |
num_ops <- choose (1, 5) |
|
140 |
ops <- vectorOf num_ops genQueuedOpCode |
|
141 |
jid <- genJobId |
|
142 |
return $ QueuedJob jid ops justNoTs justNoTs |
|
143 |
justNoTs) |
|
144 |
let jobs = head sample_jobs |
|
145 |
serialized = encode jobs |
|
138 |
jobs <- genSample (vectorOf num_jobs $ do |
|
139 |
num_ops <- choose (1, 5) |
|
140 |
ops <- vectorOf num_ops genQueuedOpCode |
|
141 |
jid <- genJobId |
|
142 |
return $ QueuedJob jid ops justNoTs justNoTs justNoTs) |
|
143 |
let serialized = encode jobs |
|
146 | 144 |
-- check for non-ASCII fields, usually due to 'arbitrary :: String' |
147 | 145 |
mapM_ (\job -> when (any (not . isAscii) (encode job)) . |
148 | 146 |
assertFailure $ "Job has non-ASCII fields: " ++ show job |
Also available in: Unified diff