-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pierre-Hugues Jeanneret
committed
Jul 19, 2017
1 parent
fe99ad4
commit 1c12086
Showing
19 changed files
with
631 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using NUnit.Framework; | ||
|
||
namespace Criteo.Profiling.Tracing.UTest | ||
{ | ||
[TestFixture] | ||
public class T_SpanState | ||
{ | ||
private const long traceIdHigh = SpanState.NoTraceIdHigh; | ||
private const long traceId = 1; | ||
private const long spanId = 1; | ||
private const SpanFlags flags = SpanFlags.None; | ||
|
||
[Test] | ||
public void HashCodeShouldVaryIfTraceIdsAreNotEqual() | ||
{ | ||
var spanState1 = new SpanState(traceIdHigh, 1, null, spanId, flags); | ||
var spanState2 = new SpanState(traceIdHigh, 2, null, spanId, flags); | ||
Assert.AreNotEqual(spanState1.GetHashCode(), spanState2.GetHashCode()); | ||
} | ||
|
||
[Test] | ||
public void EqualsShouldReturnFalseIfTraceIdsAreNotEqual() | ||
{ | ||
var spanState1 = new SpanState(traceIdHigh, 1, null, spanId, flags); | ||
var spanState2 = new SpanState(traceIdHigh, 2, null, spanId, flags); | ||
Assert.AreNotEqual(spanState1, spanState2); | ||
} | ||
|
||
[Test] | ||
public void HashCodeShouldVaryIfTraceIdHighsAreNotEqual() | ||
{ | ||
var spanState1 = new SpanState(1, traceId, null, spanId, flags); | ||
var spanState2 = new SpanState(2, traceId, null, spanId, flags); | ||
Assert.AreNotEqual(spanState1.GetHashCode(), spanState2.GetHashCode()); | ||
} | ||
|
||
[Test] | ||
public void EqualsShouldReturnFalseIfTraceIdHighsAreNotEqual() | ||
{ | ||
var spanState1 = new SpanState(1, traceId, null, spanId, flags); | ||
var spanState2 = new SpanState(2, traceId, null, spanId, flags); | ||
Assert.AreNotEqual(spanState1, spanState2); | ||
} | ||
|
||
[Test] | ||
public void HashCodeShouldVaryIfSpanIdsAreNotEqual() | ||
{ | ||
var spanState1 = new SpanState(traceIdHigh, traceId, null, 1, flags); | ||
var spanState2 = new SpanState(traceIdHigh, traceId, null, 2, flags); | ||
Assert.AreNotEqual(spanState1.GetHashCode(), spanState2.GetHashCode()); | ||
} | ||
|
||
[Test] | ||
public void EqualsShouldReturnFalseIfSpanIdsAreNotEqual() | ||
{ | ||
var spanState1 = new SpanState(traceIdHigh, traceId, null, 1, flags); | ||
var spanState2 = new SpanState(traceIdHigh, traceId, null, 2, flags); | ||
Assert.AreNotEqual(spanState1, spanState2); | ||
} | ||
|
||
[Test] | ||
public void TraceIdHighDefaultToZero() | ||
{ | ||
var spanState = new SpanState(traceId, null, spanId, flags); | ||
Assert.AreEqual(SpanState.NoTraceIdHigh, spanState.TraceIdHigh); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.