1 // Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root directory).
5 package org.rocksdb.util;
6 
7 import org.junit.Test;
8 
9 import static org.assertj.core.api.Assertions.assertThat;
10 
11 public class SizeUnitTest {
12 
13   public static final long COMPUTATION_UNIT = 1024L;
14 
15   @Test
sizeUnit()16   public void sizeUnit() {
17     assertThat(SizeUnit.KB).isEqualTo(COMPUTATION_UNIT);
18     assertThat(SizeUnit.MB).isEqualTo(
19         SizeUnit.KB * COMPUTATION_UNIT);
20     assertThat(SizeUnit.GB).isEqualTo(
21         SizeUnit.MB * COMPUTATION_UNIT);
22     assertThat(SizeUnit.TB).isEqualTo(
23         SizeUnit.GB * COMPUTATION_UNIT);
24     assertThat(SizeUnit.PB).isEqualTo(
25         SizeUnit.TB * COMPUTATION_UNIT);
26   }
27 }
28