public void ADL_Debug_SetAllPrefixes_Test() { //Flag is required to find tags made up of unique masks(example: 2|8) Debug.PrefixLookupMode = PrefixLookupSettings.AddPrefixIfAvailable; ADLLogger logger = new ADLLogger(InternalADLProjectDebugConfig.Settings, "UnitTest"); logger.SetAllPrefixes("Hello", "HELLO1", "HOLA2"); Assert.True(logger.GetMaskPrefix(1) == "Hello"); Assert.True(logger.GetMaskPrefix(2) == "HELLO1"); Assert.True(logger.GetMaskPrefix(4) == "HOLA2"); }
public void ADL_Debug_GetMaskPrefix_Test() { ADLLogger logger = new ADLLogger("UnitTest"); //Flag is required to find tags made up of unique masks(example: 2|8) Debug.PrefixLookupMode = PrefixLookupSettings.Addprefixifavailable; logger.SetAllPrefixes("Hello", "HELLO1", "HOLA2"); BitMask bm = 2; Assert.True(logger.GetMaskPrefix(bm) == "HELLO1"); Debug.PrefixLookupMode = PrefixLookupSettings.Addprefixifavailable | PrefixLookupSettings.Onlyoneprefix; bm = 32; Assert.False(logger.GetMaskPrefix(bm) == "HELLO1"); Debug.PrefixLookupMode = PrefixLookupSettings.Addprefixifavailable | PrefixLookupSettings.Bakeprefixes | PrefixLookupSettings.Deconstructmasktofind; bm = 32; Assert.False(logger.GetMaskPrefix(bm) == "HELLO1"); }
public void ADL_Debug_GetMaskPrefix_Test() { ADLLogger logger = new ADLLogger(InternalADLProjectDebugConfig.Settings, "UnitTest"); //Flag is required to find tags made up of unique masks(example: 2|8) Debug.PrefixLookupMode = PrefixLookupSettings.AddPrefixIfAvailable; logger.SetAllPrefixes("Hello", "HELLO1", "HOLA2"); BitMask bm = 2; Assert.True(logger.GetMaskPrefix(bm) == "HELLO1"); Debug.PrefixLookupMode = PrefixLookupSettings.AddPrefixIfAvailable | PrefixLookupSettings.OnlyOnePrefix; bm = 32; Assert.False(logger.GetMaskPrefix(bm) == "HELLO1"); Debug.PrefixLookupMode = PrefixLookupSettings.AddPrefixIfAvailable | PrefixLookupSettings.BakePrefixes | PrefixLookupSettings.DeconstructMaskToFind; bm = 32; Assert.False(logger.GetMaskPrefix(bm) == "HELLO1"); }
public void ADL_Debug_AddPrefixForMask_Test() { //Flag is required to find tags made up of unique masks(example: 2|8) Debug.PrefixLookupMode = PrefixLookupSettings.AddPrefixIfAvailable | PrefixLookupSettings.DeconstructMaskToFind; ADLLogger logger = new ADLLogger(InternalADLProjectDebugConfig.Settings, "UnitTest"); BitMask bm = new BitMask(2 | 8); logger.AddPrefixForMask(bm | 4, "Test"); logger.AddPrefixForMask(bm | 4, "Test"); logger.RemoveAllPrefixes(); logger.AddPrefixForMask(bm, "HELLO"); bool ret = logger.GetMaskPrefix(bm) == "HELLO"; Assert.True(ret); }
public void ADL_Debug_AddPrefixForMask_Test() { //Flag is required to find tags made up of unique masks(example: 2|8) Debug.PrefixLookupMode = PrefixLookupSettings.Addprefixifavailable | PrefixLookupSettings.Deconstructmasktofind; ADLLogger logger = new ADLLogger("UnitTest"); BitMask bm = new BitMask(2 | 8); Debug.AdlEnabled = false; logger.AddPrefixForMask(bm | 4, "Test"); logger.AddPrefixForMask(bm | 4, "Test"); logger.RemoveAllPrefixes(); logger.AddPrefixForMask(bm, "HELLO"); Debug.AdlEnabled = true; bool ret = logger.GetMaskPrefix(bm) == "HELLO"; Assert.True(ret); }
public void ADL_Debug_SetAllPrefixes_Test() { //Flag is required to find tags made up of unique masks(example: 2|8) Debug.PrefixLookupMode = PrefixLookupSettings.Addprefixifavailable; ADLLogger logger = new ADLLogger("UnitTest"); logger.SetAllPrefixes("Hello", "HELLO1", "HOLA2"); Assert.True(logger.GetMaskPrefix(1) == "Hello"); Assert.True(logger.GetMaskPrefix(2) == "HELLO1"); Assert.True(logger.GetMaskPrefix(4) == "HOLA2"); logger.RemoveAllPrefixes(); Debug.AdlEnabled = false; logger.SetAllPrefixes("Hello", "HELLO1", "HOLA2"); Assert.True(logger.GetMaskPrefix(1) == "Hello"); Assert.True(logger.GetMaskPrefix(2) == "HELLO1"); Assert.True(logger.GetMaskPrefix(4) == "HOLA2"); Debug.AdlEnabled = true; }