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

Function test_vector_set_size

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

Source from the content-addressed store, hash-verified

23
24
25def test_vector_set_size():
26 v = vector(3)
27
28 v.set_size(0)
29 assert len(v) == 0
30 assert v.shape == (0, 1)
31
32 v.resize(10)
33 assert len(v) == 10
34 assert v.shape == (10, 1)
35 for i in range(10):
36 assert v[i] == 0
37
38
39def test_vector_init_with_list():

Callers

nothing calls this directly

Calls 5

vectorClass · 0.90
lenFunction · 0.85
rangeFunction · 0.50
set_sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected