-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathtest_types_cpu.py
More file actions
31 lines (24 loc) · 860 Bytes
/
test_types_cpu.py
File metadata and controls
31 lines (24 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
import unittest
import gdb
import crash.types.cpu as cpus
class TestCPU(unittest.TestCase):
def test_online_cpu_iteration(self):
count = 0
for cpu in cpus.for_each_online_cpu():
self.assertTrue(type(cpu) is int)
count += 1
self.assertTrue(count > 0)
def test_highest_online_cpu(self):
cpu = cpus.highest_online_cpu_nr()
self.assertTrue(type(cpu) is int)
def test_possible_cpu_iteration(self):
count = 0
for cpu in cpus.for_each_possible_cpu():
self.assertTrue(type(cpu) is int)
count += 1
self.assertTrue(count > 0)
def test_highest_possible_cpu(self):
cpu = cpus.highest_possible_cpu_nr()
self.assertTrue(type(cpu) is int)