コード例 #1
0
        public void AffinityToCoreString_16CoreBitsAlt_ReturnsTrue()
        {
            var _inputArr = 0xAAAA; // core1-core15 alternating
            var match     = "1,3,5,7,9,11,13,15";

            var result = BitmaskExtensions.AffinityToCoreString((long)_inputArr);

            Assert.IsTrue(String.Equals(result, match));
        }
コード例 #2
0
        public void AffinityToCoreString_SanityCheck_ReturnsTrue()
        {
            // use an insane input to check for sane output
            long inputVal = 0x1FFFFFFFFFFFF; // core0-core47
            var  match    = "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31";

            var result = BitmaskExtensions.AffinityToCoreString((long)inputVal);

            // test for sane output (should truncate to first 32 cores [0-31])
            Assert.IsTrue(String.Equals(result, match));
        }
コード例 #3
0
        public void AffinityToCoreString_QuadCoreBits_ReturnsTrue()
        {
            // use first four bits (4 cores)
            var _inputArr = 0xF;
            var match     = "0,1,2,3";

            var result = BitmaskExtensions.AffinityToCoreString((long)_inputArr);

            // use an exact string equality comparison
            Assert.IsTrue(String.Equals(result, match));
        }