MCPcopy Create free account
hub / github.com/davisking/dlib / test_points

Function test_points

tools/python/test/test_point.py:36–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def test_points():
37 ps = points()
38
39 ps.resize(5)
40 assert len(ps) == 5
41 for i in range(5):
42 assert ps[i].x == 0
43 assert ps[i].y == 0
44
45 ps.clear()
46 assert len(ps) == 0
47
48 ps.extend([point(1, 2), point(3, 4)])
49 assert len(ps) == 2
50
51 ser = pickle.dumps(ps, 2)
52 deser = pickle.loads(ser)
53 assert deser[0].x == 1
54 assert deser[0].y == 2
55 assert deser[1].x == 3
56 assert deser[1].y == 4

Callers

nothing calls this directly

Calls 5

pointClass · 0.90
lenFunction · 0.85
rangeFunction · 0.50
resizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected