Skip to content

Commit

Permalink
Adjust memory size in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Sep 5, 2022
1 parent 3d00294 commit 3d725d9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions internal/api/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func TestGetMetrics(t *testing.T) {
assert.Equal(t, &types.Metrics{
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)

// Instantiate 2
Expand All @@ -216,7 +216,7 @@ func TestGetMetrics(t *testing.T) {
HitsMemoryCache: 1,
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)

// Pin
Expand All @@ -231,8 +231,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5665691,
SizeMemoryCache: 5665691,
SizePinnedMemoryCache: 5602873,
SizeMemoryCache: 5602873,
}, metrics)

// Instantiate 3
Expand All @@ -249,8 +249,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5665691,
SizeMemoryCache: 5665691,
SizePinnedMemoryCache: 5602873,
SizeMemoryCache: 5602873,
}, metrics)

// Unpin
Expand All @@ -267,7 +267,7 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)

// Instantiate 4
Expand All @@ -285,7 +285,7 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)
}

Expand Down
16 changes: 8 additions & 8 deletions lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func TestGetMetrics(t *testing.T) {
assert.Equal(t, &types.Metrics{
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)

// Instantiate 2
Expand All @@ -214,7 +214,7 @@ func TestGetMetrics(t *testing.T) {
HitsMemoryCache: 1,
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)

// Pin
Expand All @@ -229,8 +229,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5665691,
SizeMemoryCache: 5665691,
SizePinnedMemoryCache: 5602873,
SizeMemoryCache: 5602873,
}, metrics)

// Instantiate 3
Expand All @@ -248,8 +248,8 @@ func TestGetMetrics(t *testing.T) {
HitsFsCache: 1,
ElementsPinnedMemoryCache: 1,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 5665691,
SizeMemoryCache: 5665691,
SizePinnedMemoryCache: 5602873,
SizeMemoryCache: 5602873,
}, metrics)

// Unpin
Expand All @@ -266,7 +266,7 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)

// Instantiate 4
Expand All @@ -285,6 +285,6 @@ func TestGetMetrics(t *testing.T) {
ElementsPinnedMemoryCache: 0,
ElementsMemoryCache: 1,
SizePinnedMemoryCache: 0,
SizeMemoryCache: 5665691,
SizeMemoryCache: 5602873,
}, metrics)
}
2 changes: 1 addition & 1 deletion libwasmvm/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ mod tests {
misses: 0,
elements_pinned_memory_cache: 1,
elements_memory_cache: 0,
size_pinned_memory_cache: 5665691,
size_pinned_memory_cache: 5602873,
size_memory_cache: 0,
}
);
Expand Down

0 comments on commit 3d725d9

Please sign in to comment.