Skip to content

Commit

Permalink
Adapt tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Mar 1, 2022
1 parent 998d802 commit f70832d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions api/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestGetMetrics(t *testing.T) {
assert.Equal(t, &types.Metrics{
HitsFsCache: 1,
ElementsMemoryCache: 1,
SizeMemoryCache: 5549819,
SizeMemoryCache: 5563894,
}, metrics)

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

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

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

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

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

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

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

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

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

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

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

0 comments on commit f70832d

Please sign in to comment.