@@ -26,42 +26,42 @@ func TestAddResult(t *testing.T) {
2626 AddResult (nil , & endpoint.Result {Timestamp : time .Now ()}, storage .DefaultMaximumNumberOfResults , storage .DefaultMaximumNumberOfEvents )
2727}
2828
29- func TestCopyEndpointStatus (t * testing.T ) {
29+ func TestShallowCopyEndpointStatus (t * testing.T ) {
3030 ep := & endpoint.Endpoint {Name : "name" , Group : "group" }
3131 endpointStatus := endpoint .NewStatus (ep .Group , ep .Name )
3232 ts := time .Now ().Add (- 25 * time .Hour )
3333 for i := 0 ; i < 25 ; i ++ {
3434 AddResult (endpointStatus , & endpoint.Result {Success : i % 2 == 0 , Timestamp : ts }, storage .DefaultMaximumNumberOfResults , storage .DefaultMaximumNumberOfEvents )
3535 ts = ts .Add (time .Hour )
3636 }
37- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (- 1 , - 1 )).Results ) != 0 {
37+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (- 1 , - 1 )).Results ) != 0 {
3838 t .Error ("expected to have 0 result" )
3939 }
40- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , 1 )).Results ) != 1 {
40+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , 1 )).Results ) != 1 {
4141 t .Error ("expected to have 1 result" )
4242 }
43- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (5 , 0 )).Results ) != 0 {
43+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (5 , 0 )).Results ) != 0 {
4444 t .Error ("expected to have 0 results" )
4545 }
46- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (- 1 , 20 )).Results ) != 0 {
46+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (- 1 , 20 )).Results ) != 0 {
4747 t .Error ("expected to have 0 result, because the page was invalid" )
4848 }
49- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , - 1 )).Results ) != 0 {
49+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , - 1 )).Results ) != 0 {
5050 t .Error ("expected to have 0 result, because the page size was invalid" )
5151 }
52- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , 10 )).Results ) != 10 {
52+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , 10 )).Results ) != 10 {
5353 t .Error ("expected to have 10 results, because given a page size of 10, page 1 should have 10 elements" )
5454 }
55- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (2 , 10 )).Results ) != 10 {
55+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (2 , 10 )).Results ) != 10 {
5656 t .Error ("expected to have 10 results, because given a page size of 10, page 2 should have 10 elements" )
5757 }
58- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (3 , 10 )).Results ) != 5 {
58+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (3 , 10 )).Results ) != 5 {
5959 t .Error ("expected to have 5 results, because given a page size of 10, page 3 should have 5 elements" )
6060 }
61- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (4 , 10 )).Results ) != 0 {
61+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (4 , 10 )).Results ) != 0 {
6262 t .Error ("expected to have 0 results, because given a page size of 10, page 4 should have 0 elements" )
6363 }
64- if len (CopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , 50 )).Results ) != 25 {
64+ if len (ShallowCopyEndpointStatus (endpointStatus , paging .NewEndpointStatusParams ().WithResults (1 , 50 )).Results ) != 25 {
6565 t .Error ("expected to have 25 results, because there's only 25 results" )
6666 }
6767}
0 commit comments