Skip to content

Commit e139e82

Browse files
committed
refactor: Fetch logs from buffer to display plugin output in pact tests
1 parent 63d1758 commit e139e82

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/PactNet/Drivers/MockServerDriver.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,9 @@ public string MockServerMismatches()
5353
/// <returns>Log string</returns>
5454
public string MockServerLogs()
5555
{
56-
IntPtr logsPtr = NativeInterop.MockServerLogs(this.Port);
57-
58-
return logsPtr == IntPtr.Zero
59-
? "ERROR: Unable to retrieve mock server logs"
60-
: Marshal.PtrToStringAnsi(logsPtr);
56+
return NativeInterop.FetchLogBuffer(null);
6157
}
58+
6259
/// <summary>
6360
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
6461
/// </summary>

src/PactNet/Interop/NativeInterop.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ internal static class NativeInterop
2121
[DllImport(DllName, EntryPoint = "pactffi_mock_server_mismatches")]
2222
public static extern IntPtr MockServerMismatches(int mockServerPort);
2323

24-
[DllImport(DllName, EntryPoint = "pactffi_mock_server_logs")]
25-
public static extern IntPtr MockServerLogs(int mockServerPort);
26-
2724
[DllImport(DllName, EntryPoint = "pactffi_cleanup_mock_server")]
2825
public static extern bool CleanupMockServer(int mockServerPort);
2926

0 commit comments

Comments
 (0)