@@ -65,7 +65,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_create)
6565
6666}
6767
68- TEST (RandomEarlyDetection, test_random_early_detection_packet )
68+ TEST (RandomEarlyDetection, test_random_early_detection_congestion_check )
6969{
7070 // Test first malloc failure
7171 nsdynmemlib_stub.returnCounter = 1 ;
@@ -75,7 +75,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
7575 }
7676 bool bool_val;
7777 // Test uder threshold
78- bool_val = random_early_detection_packet (info, 63 );
78+ bool_val = random_early_detection_congestion_check (info, 63 );
7979
8080 CHECK_EQUAL (false , bool_val);
8181 BYTES_EQUAL (0 , info->count );
@@ -86,14 +86,14 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
8686 uint16_t compare_count = 1 ;
8787 for (uint16_t i = test_val; i < 89 ; i++) {
8888 // printf("%u aQ %u count\r\n", i,compare_count);
89- bool_val = random_early_detection_packet (info, i);
89+ bool_val = random_early_detection_congestion_check (info, i);
9090 CHECK_EQUAL (false , bool_val);
9191 BYTES_EQUAL (compare_count, info->count );
9292 compare_count++;
9393 BYTES_EQUAL (i * 256 , info->averageQ );
9494 }
9595
96- bool_val = random_early_detection_packet (info, 89 );
96+ bool_val = random_early_detection_congestion_check (info, 89 );
9797 CHECK_EQUAL (true , bool_val);
9898 BYTES_EQUAL (0 , info->count );
9999 BYTES_EQUAL (89 * 256 , info->averageQ );
@@ -104,14 +104,14 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
104104 compare_count = 1 ;
105105 for (uint16_t i = test_val; i < 105 ; i++) {
106106 // printf("%u aQ %u count\r\n", i,compare_count);
107- bool_val = random_early_detection_packet (info, i);
107+ bool_val = random_early_detection_congestion_check (info, i);
108108 CHECK_EQUAL (false , bool_val);
109109 BYTES_EQUAL (compare_count, info->count );
110110 compare_count++;
111111 BYTES_EQUAL (i * 256 , info->averageQ );
112112 }
113113
114- bool_val = random_early_detection_packet (info, 105 );
114+ bool_val = random_early_detection_congestion_check (info, 105 );
115115 CHECK_EQUAL (true , bool_val);
116116 BYTES_EQUAL (0 , info->count );
117117 BYTES_EQUAL (105 * 256 , info->averageQ );
@@ -121,13 +121,13 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
121121 compare_count = 1 ;
122122 for (uint16_t i = test_val; i < 118 ; i++) {
123123 // printf("%u aQ %u count\r\n", i,compare_count);
124- bool_val = random_early_detection_packet (info, i);
124+ bool_val = random_early_detection_congestion_check (info, i);
125125 CHECK_EQUAL (false , bool_val);
126126 BYTES_EQUAL (compare_count, info->count );
127127 compare_count++;
128128 BYTES_EQUAL (i * 256 , info->averageQ );
129129 }
130- bool_val = random_early_detection_packet (info, 118 );
130+ bool_val = random_early_detection_congestion_check (info, 118 );
131131 CHECK_EQUAL (true , bool_val);
132132 BYTES_EQUAL (0 , info->count );
133133 BYTES_EQUAL (118 * 256 , info->averageQ );
@@ -136,19 +136,19 @@ TEST(RandomEarlyDetection, test_random_early_detection_packet)
136136 compare_count = 1 ;
137137 for (uint16_t i = test_val; i < 128 ; i++) {
138138 // printf("%u aQ %u count\r\n", i,compare_count);
139- bool_val = random_early_detection_packet (info, i);
139+ bool_val = random_early_detection_congestion_check (info, i);
140140 CHECK_EQUAL (false , bool_val);
141141 BYTES_EQUAL (compare_count, info->count );
142142 compare_count++;
143143 BYTES_EQUAL (i * 256 , info->averageQ );
144144 }
145145
146- bool_val = random_early_detection_packet (info, 128 );
146+ bool_val = random_early_detection_congestion_check (info, 128 );
147147 CHECK_EQUAL (true , bool_val);
148148 BYTES_EQUAL (0 , info->count );
149149 BYTES_EQUAL (128 * 256 , info->averageQ );
150150
151- bool_val = random_early_detection_packet (info, 129 );
151+ bool_val = random_early_detection_congestion_check (info, 129 );
152152 CHECK_EQUAL (true , bool_val);
153153 BYTES_EQUAL (0 , info->count );
154154 BYTES_EQUAL (129 * 256 , info->averageQ );
@@ -179,7 +179,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_weight)
179179
180180 bool bool_val;
181181 for (uint16_t i = 0 ; i < 10 ; i++) {
182- bool_val = random_early_detection_packet (info, i + 1 );
182+ bool_val = random_early_detection_congestion_check (info, i + 1 );
183183 CHECK_EQUAL (false , bool_val);
184184 BYTES_EQUAL (AQList[i], info->averageQ / 256 );
185185 // printf("%u Size %x AQraw, %u AQ\r\n", i+1, info->averageQ, info->averageQ / 256);
@@ -204,7 +204,7 @@ TEST(RandomEarlyDetection, test_random_early_detection_weight)
204204 AQList[9 ] = 8 ;
205205
206206 for (uint16_t i = 0 ; i < 10 ; i++) {
207- bool_val = random_early_detection_packet (info, i + 1 );
207+ bool_val = random_early_detection_congestion_check (info, i + 1 );
208208 CHECK_EQUAL (false , bool_val);
209209 BYTES_EQUAL (AQList[i], info->averageQ / 256 );
210210 // printf("%u Size %x AQraw, %u AQ\r\n", i+1, info->averageQ, info->averageQ / 256);
0 commit comments