Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

17
LINES

< > BotCompany Repo | #1025080 // test_RollingMaximum (OK)

JavaX fragment (include)

1  
!include once #1025078 // RollingMaximum
2  
3  
svoid test_RollingMaximum() {
4  
  int windowSize = 10, n = 100000;
5  
  RollingMaximum rm = new(windowSize);
6  
  L<Double> buf = linkedList();
7  
  for i to n: {
8  
    double val = random();
9  
    addToListWithMaxSize(buf, val, rm.windowSize);
10  
    double max = rm.addAndGet(val);
11  
    try {
12  
      assertEquals/*Verbose*/(doubleMax(buf), max);
13  
    } on fail {
14  
      print(buf);
15  
    }
16  
  }
17  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025080
Snippet name: test_RollingMaximum (OK)
Eternal ID of this version: #1025080/5
Text MD5: d39db2d40da8928684d83d5e1544aa40
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-05 13:18:49
Source code size: 431 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 155 / 210
Version history: 4 change(s)
Referenced in: [show references]