Example #1
0
        public void ReportHook()
        {
            using (DummyDebugProcs debugProcs = new DummyDebugProcs(false))
            {
                ITsIncStrBldr bldr = TsIncStrBldrClass.Create();
                // next line asserts
                bldr.SetIntPropValues(1, 0, 0);

                Assert.IsTrue(debugProcs.m_fHandlerCalled);
            }
        }
Example #2
0
        public void GetMessage_AllFit()
        {
            var expectedMsg = string.Format(
                @"Assertion failed!

Program: {0}
File: bla.cpp
Line: 583

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
                ExecutableName);

            using (var debugProcs = new DummyDebugProcs())
            {
                Assert.AreEqual(expectedMsg,
                                debugProcs.CallGetMessage("The expression that failed", "bla.cpp", 583));
            }
        }
Example #3
0
        public void GetMessage_PathAndFilenameToLong()
        {
            var expectedMsg = string.Format(
                @"Assertion failed!

Program: {0}
File: /path/that/has/too/many/character...with_lon...ame.cpp
Line: 123

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
                ExecutableName);

            using (var debugProcs = new DummyDebugProcs())
            {
                Assert.AreEqual(expectedMsg,
                                debugProcs.CallGetMessage("The expression that failed",
                                                          "/path/that/has/too/many/characters/in/it/with_long_filename.cpp", 123));
            }
        }
Example #4
0
        public void GetMessage_FilenameToLong()
        {
            var expectedMsg = string.Format(
                @"Assertion failed!

Program: {0}
File: /path/with_a_ver...have_to_truncate_before_it_fits.cpp
Line: 583

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
                ExecutableName);

            using (var debugProcs = new DummyDebugProcs())
            {
                Assert.AreEqual(expectedMsg,
                                debugProcs.CallGetMessage("The expression that failed",
                                                          "/path/with_a_very_long_filename_that_we_have_to_truncate_before_it_fits.cpp", 583));
            }
        }
Example #5
0
        public void GetMessage_PathToLong()
        {
            var expectedMsg = string.Format(
                @"Assertion failed!

Program: {0}
File: /this/is/a/very/long/path/that/extends...{1}truncate.cpp
Line: 583

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
                ExecutableName, Path.DirectorySeparatorChar);

            using (var debugProcs = new DummyDebugProcs())
            {
                Assert.AreEqual(expectedMsg,
                                debugProcs.CallGetMessage("The expression that failed",
                                                          "/this/is/a/very/long/path/that/extends/beyond/sixty/characters/so/that/we/have/to/truncate.cpp", 583));
            }
        }
Example #6
0
		public void ReportHook()
		{
			using (DummyDebugProcs debugProcs = new DummyDebugProcs(false))
			{
				ITsIncStrBldr bldr = TsIncStrBldrClass.Create();
				// next line asserts
				bldr.SetIntPropValues(1, 0, 0);

				Assert.IsTrue(debugProcs.m_fHandlerCalled);
			}
		}
Example #7
0
		public void GetMessage_AllFit()
		{
			var expectedMsg = string.Format(
@"Assertion failed!

Program: {0}
File: bla.cpp
Line: 583

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
					ExecutableName);

			using (var debugProcs = new DummyDebugProcs())
			{
				Assert.AreEqual(expectedMsg,
					debugProcs.CallGetMessage("The expression that failed", "bla.cpp", 583));
			}
		}
Example #8
0
		public void GetMessage_PathAndFilenameToLong()
		{
			var expectedMsg = string.Format(
@"Assertion failed!

Program: {0}
File: /path/that/has/too/many/character...with_lon...ame.cpp
Line: 123

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
					ExecutableName);

			using (var debugProcs = new DummyDebugProcs())
			{
				Assert.AreEqual(expectedMsg,
					debugProcs.CallGetMessage("The expression that failed",
					"/path/that/has/too/many/characters/in/it/with_long_filename.cpp", 123));
			}
		}
Example #9
0
		public void GetMessage_FilenameToLong()
		{
			var expectedMsg = string.Format(
@"Assertion failed!

Program: {0}
File: /path/with_a_ver...have_to_truncate_before_it_fits.cpp
Line: 583

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
					ExecutableName);

			using (var debugProcs = new DummyDebugProcs())
			{
				Assert.AreEqual(expectedMsg,
					debugProcs.CallGetMessage("The expression that failed",
					"/path/with_a_very_long_filename_that_we_have_to_truncate_before_it_fits.cpp", 583));
			}
		}
Example #10
0
		public void GetMessage_PathToLong()
		{
			var expectedMsg = string.Format(
@"Assertion failed!

Program: {0}
File: /this/is/a/very/long/path/that/extends...{1}truncate.cpp
Line: 583

Expression: The expression that failed

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)",
					ExecutableName, Path.DirectorySeparatorChar);

			using (var debugProcs = new DummyDebugProcs())
			{
				Assert.AreEqual(expectedMsg,
					debugProcs.CallGetMessage("The expression that failed",
					"/this/is/a/very/long/path/that/extends/beyond/sixty/characters/so/that/we/have/to/truncate.cpp", 583));
			}
		}