Changeset View
Changeset View
Standalone View
Standalone View
src/filesystem/memory/__tests__/ArcanistHostMemorySnapshotTestCase.php
<?php | <?php | ||||
final class ArcanistHostMemorySnapshotTestCase | final class ArcanistHostMemorySnapshotTestCase | ||||
extends PhutilTestCase { | extends PhutilTestCase { | ||||
public function testSnapshotSwapTotalBytes() { | public function testSnapshotSwapTotalBytes() { | ||||
$test_cases = array( | $test_cases = array( | ||||
'meminfo_swap_normal.txt' => 4294963200, | 'meminfo_swap_normal.txt' => 4294963200, | ||||
'meminfo_swap_zero.txt' => 0, | 'meminfo_swap_zero.txt' => 0, | ||||
'meminfo_swap_missing.txt' => false, | 'meminfo_swap_missing.txt' => false, | ||||
'meminfo_swap_invalid.txt' => false, | 'meminfo_swap_invalid.txt' => false, | ||||
'meminfo_swap_badunits.txt' => false, | 'meminfo_swap_badunits.txt' => false, | ||||
'meminfo_swap_duplicate.txt' => false, | 'meminfo_swap_duplicate.txt' => false, | ||||
); | ); | ||||
$test_dir = dirname(__FILE__).'/data/'; | $test_dir = __DIR__.'/data/'; | ||||
foreach ($test_cases as $test_file => $expect) { | foreach ($test_cases as $test_file => $expect) { | ||||
$test_data = Filesystem::readFile($test_dir.$test_file); | $test_data = Filesystem::readFile($test_dir.$test_file); | ||||
$caught = null; | $caught = null; | ||||
$actual = null; | $actual = null; | ||||
try { | try { | ||||
$snapshot = ArcanistHostMemorySnapshot::newFromRawMeminfo( | $snapshot = ArcanistHostMemorySnapshot::newFromRawMeminfo( | ||||
Show All 27 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0