Skip to content

Commit

Permalink
Adjust testcases to account for the additional bucket
Browse files Browse the repository at this point in the history
  • Loading branch information
gr0vity authored and gr0vity-dev committed Jul 9, 2024
1 parent 3b8b57d commit 76c5a85
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nano/core_test/scheduler_buckets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,23 @@ TEST (buckets, construction)
nano::scheduler::buckets buckets;
ASSERT_EQ (0, buckets.size ());
ASSERT_TRUE (buckets.empty ());
ASSERT_EQ (62, buckets.bucket_count ());
ASSERT_EQ (63, buckets.bucket_count ());
}

TEST (buckets, insert_Gxrb)
{
nano::scheduler::buckets buckets;
buckets.push (1000, block0 (), nano::Gxrb_ratio);
ASSERT_EQ (1, buckets.size ());
ASSERT_EQ (1, buckets.bucket_size (48));
ASSERT_EQ (1, buckets.bucket_size (49));
}

TEST (buckets, insert_Mxrb)
{
nano::scheduler::buckets buckets;
buckets.push (1000, block1 (), nano::Mxrb_ratio);
ASSERT_EQ (1, buckets.size ());
ASSERT_EQ (1, buckets.bucket_size (13));
ASSERT_EQ (1, buckets.bucket_size (14));
}

// Test two blocks with the same priority
Expand All @@ -138,7 +138,7 @@ TEST (buckets, insert_same_priority)
buckets.push (1000, block0 (), nano::Gxrb_ratio);
buckets.push (1000, block2 (), nano::Gxrb_ratio);
ASSERT_EQ (2, buckets.size ());
ASSERT_EQ (2, buckets.bucket_size (48));
ASSERT_EQ (2, buckets.bucket_size (49));
}

// Test the same block inserted multiple times
Expand All @@ -148,7 +148,7 @@ TEST (buckets, insert_duplicate)
buckets.push (1000, block0 (), nano::Gxrb_ratio);
buckets.push (1000, block0 (), nano::Gxrb_ratio);
ASSERT_EQ (1, buckets.size ());
ASSERT_EQ (1, buckets.bucket_size (48));
ASSERT_EQ (1, buckets.bucket_size (49));
}

TEST (buckets, insert_older)
Expand Down

0 comments on commit 76c5a85

Please sign in to comment.