Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
a89cf16
Add basic test cases for the importer class.
izrik May 14, 2024
617632f
Make the gen scripts PWD-invariant.
izrik May 14, 2024
c60d6a9
Adjust the test case.
izrik May 14, 2024
9df159d
Don't overwrite output files that are newer than the input files. Add…
izrik May 14, 2024
b7cdcc5
Add a --verbose flag.
izrik May 14, 2024
d315e99
Add more test cases.
izrik May 14, 2024
deeea4a
Test the Initialize method.
izrik May 14, 2024
3f37a00
Fill out the C# code for uninitialized importer.
izrik May 15, 2024
d376c1d
Extract the PrintPropertyValue function.
izrik May 15, 2024
074e194
Extract the CanPrintPropertyValue function.
izrik May 15, 2024
697c746
Add some tests for after the importer is initialized (some C# tests f…
izrik May 16, 2024
ecf85c9
Print enums.
izrik May 16, 2024
8fa3d60
Fix comment.
izrik May 16, 2024
5a133a2
Wrap the test fixtures in a file object.
izrik May 17, 2024
8393daa
Add extra lines to files and fixtures.
izrik May 17, 2024
c914902
Allow for using constraint syntax, so nunit stop nagging so much.
izrik May 17, 2024
ade416a
Convert long-long C++ syntax to C# equivalent.
izrik May 17, 2024
fcf5cec
Confirm some behavior of FbxTime. Fill in a couple of missing methods.
izrik May 17, 2024
6d77d16
Sort the test fixtures by name.
izrik May 18, 2024
01a1f56
Allow for filtering the tests to be run based on command-line arguments.
izrik May 31, 2024
90b1030
Flesh out some things related to properties.
izrik Jun 3, 2024
4dea2cc
Fill out the FbxIOSettings class, with tests.
izrik Jun 3, 2024
eb4f89d
Add ascii and binary revisions of the model and in two different form…
izrik Jun 4, 2024
088b3fe
Fix indenting.
izrik Jun 4, 2024
c46f2ff
Add a location-invariant facility for getting paths to the sample files.
izrik Jun 5, 2024
c5a3c7a
Determine if the file is binary or ascii. Read the header info from a…
izrik Jun 5, 2024
c26e70f
Fully stub out FbxIOBase. Set the importer's name correctly.
izrik Jun 5, 2024
33960eb
Set the importer's io settings. Use proper default name.
izrik Jun 5, 2024
82bb764
Set major, minor, and revision from the file header info.
izrik Jun 5, 2024
a3e2227
Fix the error string for successes.
izrik Jun 5, 2024
988cb1f
format
izrik Jun 5, 2024
cd037ab
Fix virtual/abstract/override on FbxImporter and FbxIOBase.
izrik Jun 5, 2024
484faee
Parse the file version from binary files.
izrik Jun 6, 2024
ef00007
Allow for new without the auto-appended type.
izrik Jun 12, 2024
00b5e36
Add some more constructors and proper equality comparisons.
izrik Jun 15, 2024
1408184
Clean up.
izrik Jun 19, 2024
09980a1
Make the script run from other locations.
izrik Jun 19, 2024
9105f34
Pass any other command-line args to the generator.
izrik Jun 19, 2024
761ae59
Add more assertions.
izrik Jun 19, 2024
b9c14c1
Check the list correctly.
izrik Jun 20, 2024
d33bbd2
Re-format
izrik Jun 20, 2024
4b62a55
More equality comparison.
izrik Jun 20, 2024
3559d7e
Be more specific about removing asterisks.
izrik Jun 20, 2024
1364592
Avoid index errors.
izrik Jun 20, 2024
910c204
diag
izrik Jun 20, 2024
8757340
Print date times.
izrik Jun 20, 2024
2fb434d
Optionally populate an existing scene object, instead of allocating a…
izrik Jun 20, 2024
286ea4b
Stub out FbxDocument and related.
izrik Jun 20, 2024
05cb1f6
First effort at binary parser.
izrik Jun 20, 2024
3018262
Return an invalid property instead of null.
izrik Jun 20, 2024
017ec89
Adjust asterisk.
izrik Jun 20, 2024
a0c6c40
Return values.
izrik Jun 20, 2024
ed44a2a
Re-work the generator's CLI parameters, for massive speedup and usabi…
izrik Jun 21, 2024
d521a8b
Add tests for FbxDocumentInfo.
izrik Jun 22, 2024
88b3502
Finish out FbxDocumentInfo's properties.
izrik Jun 25, 2024
2ce273c
Put built-in data types into a static class.
izrik Jun 25, 2024
6a71cce
Test the FindPropertyHierarchical method.
izrik Jun 25, 2024
ffc6c27
Use the built-in data types instead of creating new ones.
izrik Jun 25, 2024
6dc2847
Fix the valid flag on some data types.
izrik Jun 25, 2024
44ab0fb
Use the built-in data types instead of creating new ones. Also some c…
izrik Jun 25, 2024
93d60cb
Find properties including descendants.
izrik Jun 25, 2024
2237d1d
Set the property hierarchy correctly.
izrik Jun 25, 2024
87373bb
Actually pass the scene to the converter, so it doesn't create a new …
izrik Jun 26, 2024
554e70f
Search the property hierarchy starting from the root.
izrik Jun 26, 2024
a53df31
Re-work the constructor.
izrik Jun 26, 2024
890730d
Check for an invalid property as well.
izrik Jun 26, 2024
00591d0
Unimplement an incorrectly-implemented, unused factory method.
izrik Jun 26, 2024
b864c14
Test for the more specific data types.
izrik Jun 27, 2024
1e78c43
Test data type equality.
izrik Jun 27, 2024
4589bd9
Generate a more helpful string representation.
izrik Jun 27, 2024
882ebf1
Fix strings.
izrik Jun 27, 2024
78c06b2
Use more specific data types.
izrik Jun 27, 2024
c5dda9d
Fix assertion transforms.
izrik Jun 27, 2024
23c4416
Refer to the function correctly.
izrik Jun 27, 2024
12e61ec
Re-work property hierarchy, instantiation, and data types, to more cl…
izrik Jun 27, 2024
d1b6afc
Implement GetFbxObject more cleanly. Remove extraneous interlinking a…
izrik Jul 2, 2024
7a548f4
Read the full header in both ascii and binary.
izrik Jul 9, 2024
3736f9b
Use fbx-flavored types for the properties.
izrik Jul 9, 2024
8f999f9
comments
izrik Jul 9, 2024
4fdc1c4
attribute
izrik Jul 10, 2024
1b6db5c
Add more samples with different format versions.
izrik Jul 10, 2024
27f47d4
Split BinaryParser into base and subclass.
izrik Jul 10, 2024
e6daf94
Add a parser subcless for 7400.
izrik Jul 11, 2024
7178f00
Use the 7400 parser for 7300.
izrik Jul 11, 2024
7e9f53c
Add some simple test cases for test classes that don't have any.
izrik Aug 23, 2024
054edf3
Add some tests of the parser version-choosing logic.
izrik Aug 23, 2024
d2f6dd0
Read arrays from the file.
izrik Aug 23, 2024
cedda06
Add a makefile and code for generating samples.
izrik Oct 23, 2024
4fe9008
Fix some segfaults.
izrik Apr 17, 2025
6fb9669
Read boolean values.
izrik Apr 21, 2025
4149654
Read compressed arrays of ints.
izrik Apr 21, 2025
8885e93
Read arrays of doubles.
izrik Apr 21, 2025
6f5973a
Check if the property is valid.
izrik Apr 21, 2025
3f6cf56
Add some basic built-in conversions.
izrik Apr 21, 2025
1aba761
Adjust how property values are set.
izrik Apr 21, 2025
9a26d0a
Fix formatting.
izrik Apr 21, 2025
80b3602
Display the index, if available.
izrik Apr 21, 2025
fe436ba
Add an implicit conversion.
izrik Apr 21, 2025
d0ac218
Print the correct type.
izrik Apr 21, 2025
e689cec
Adjust output.
izrik Apr 21, 2025
2ad2d04
Flesh out the converter.
izrik Apr 21, 2025
f2222d1
Implement for FbxTime.
izrik Apr 21, 2025
67f7e86
Implement TransformAssociateModelMatrix.
izrik Apr 21, 2025
c31c176
Adjust how property values are set.
izrik Apr 21, 2025
c9a4fef
Convert to 3-vectors.
izrik Apr 21, 2025
88c2897
Fix typo.
izrik Apr 21, 2025
7a9faf0
Fix test.
izrik Apr 21, 2025
ac3bf17
Give a non-zero return value when there are test failures.
izrik Apr 22, 2025
68f52cf
Fill out FbxNull.
izrik Apr 22, 2025
bf9c0e1
Use the existing scene object, instead of creating another.
izrik Apr 22, 2025
4f3237a
Add explicit check.
izrik Apr 22, 2025
b095e40
Print out additional info about the object's name and namespace.
izrik Apr 22, 2025
1060781
Check the namespace prefix.
izrik Apr 22, 2025
1b6e0e3
Print the values of eFbxEnum properties.
izrik Apr 22, 2025
0020219
Don't throw on FbxNull.
izrik Apr 22, 2025
3e301ae
todo
izrik Apr 22, 2025
fa1053f
Top-level docstring.
izrik Apr 22, 2025
6b0f70e
Clean up.
izrik May 15, 2025
82ae9c0
Re-organize and stub out FbxTime.
izrik May 16, 2025
2f4b7f9
Fix test file generation in the makefile.
izrik May 16, 2025
0b24ac6
Clean up.
izrik May 16, 2025
6842474
Fix tests.
izrik May 16, 2025
eb505b1
Add the inflate command for decompressing byte streams.
izrik May 16, 2025
14c7b7c
Read compressed float and int64 arrays.
izrik May 16, 2025
b74cc0a
Convert arrays into vectors.
izrik May 16, 2025
28fd7a9
Convert arrays into anim curve key items.
izrik May 16, 2025
0dc079f
Default to the current directory.
izrik May 16, 2025
8e66218
todo
izrik May 16, 2025
5177d10
Remove diagnostics.
izrik May 16, 2025
d8112e5
Stub out a 6100 parser.
izrik May 18, 2025
0843c79
Add out and ref modifiers.
izrik Jul 8, 2025
a999693
Trace the changes in a specific line.
izrik Jul 8, 2025
69b7b02
Manage changes to the value with a struct.
izrik Jul 9, 2025
3770b60
Implement and test global settings and friends.
izrik Jul 10, 2025
b32f575
Adjust anim curve tests.
izrik Jul 10, 2025
b17370d
Trace changes properly.
izrik Jul 10, 2025
3ac1219
Adjust FbxTime test.
izrik Jul 10, 2025
caf7595
Generate animation-related samples.
izrik Jul 10, 2025
4f64dbe
Print nulls more clearly.
izrik Jul 10, 2025
b1e70ba
Include sudo in the image.
izrik Jul 10, 2025
bc98336
Clean up.
izrik Jul 10, 2025
d06f38e
Implement and Test KeyGet.
izrik Jul 10, 2025
f72a20f
Add missing files.
izrik Jul 10, 2025
37fedca
Support FbxVector4.
izrik Jul 10, 2025
ff9a605
Print the global time mode and protocol.
izrik Jul 10, 2025
2493695
Extract static method.
izrik Jul 10, 2025
d4f83b0
Clean up a little.
izrik Jul 10, 2025
3441e4c
Print the parse objects from binary files.
izrik Jul 12, 2025
1b5d969
Not sdk
izrik Jul 12, 2025
7471a7c
Expand the 'convert' command to use any format or version. Remove the…
izrik Jul 14, 2025
a1c11ea
Move the time constants to a separate static class.
izrik Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,4 @@ _scratch*
*.pyc
.vs
.DS_Store
*.blend1
83 changes: 83 additions & 0 deletions FbxCli/InflateCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using NCommander;

namespace FbxCli;

public class InflateCommand : Command
{
public static readonly InflateCommand Value = new();

private InflateCommand()
{
Name = "inflate";
Description = "Decompress a sequence of bytes";
Params =
[
new Parameter
{
Name = "filename",
Description = "File to get the bytes from",
ParameterType = ParameterType.String,
IsOptional = true,
}
];
Options =
[
new Option
{
Name = "hex-out",
Description = "Display the output as a space-separated sequence of hexadecimal bytes",
Type = ParameterType.Flag,
}
];
}

protected override void InternalExecute(Dictionary<string, object> args)
{
var filename = string.Empty;
if (args.ContainsKey("filename"))
filename = (string)args["filename"];

var hexOut = false;
if (args.ContainsKey("hex-out"))
hexOut = (bool)args["hex-out"];

using var stream = (
string.IsNullOrWhiteSpace(filename) || filename == "-"
? System.Console.OpenStandardInput()
: File.Open(filename, FileMode.Open));
using var zs = new ZLibStream(stream, CompressionMode.Decompress,
true);
using var stdout = System.Console.OpenStandardOutput();
using var writer = System.Console.Out;

var total = 0;
var buffer = new byte[4096];
while (true)
{
var numBytesRead = zs.Read(buffer, 0, 4096);
if (numBytesRead < 1)
break;
total += numBytesRead;
if (hexOut)
{
int i;
for (i = 0; i < numBytesRead; i++)
{
writer.Write("{0:x2} ", buffer[i]);
if (i % 16 == 7)
writer.Write(" ");
if (i % 16 == 15)
writer.WriteLine();
}

if (i % 16 != 0)
writer.WriteLine();
}
else
stdout.Write(buffer, 0, numBytesRead);
}
}
}
4 changes: 2 additions & 2 deletions FbxCli/LsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ void SetIndexes(int n)
Console.WriteLine($" Frame count precise: {t.GetFrameCountPrecise()}");
Console.WriteLine($" Field count: {t.GetFieldCount()}");
Console.WriteLine($" Global time mode: {FbxTime.GetGlobalTimeMode()}");
Console.WriteLine($" FBXSDK_TC_MILLISECOND: {FbxTime.FBXSDK_TC_MILLISECOND}");
Console.WriteLine($" FBXSDK_TC_SECOND: {FbxTime.FBXSDK_TC_SECOND}");
Console.WriteLine($" FBXSDK_TC_MILLISECOND: {FbxTimeCode.FBXSDK_TC_MILLISECOND}");
Console.WriteLine($" FBXSDK_TC_SECOND: {FbxTimeCode.FBXSDK_TC_SECOND}");
break;
case "sprop":
N = obj.GetSrcPropertyCount();
Expand Down
22 changes: 16 additions & 6 deletions FbxCli/PrintCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,24 @@ protected override void InternalExecute(Dictionary<string, object> args)
}
if (parse)
{
using (var reader = new StreamReader(filename))
var fhi = FbxImporter.GetFileHeaderInfo(filename);
List<ParseObject> parseObjects = null;
if (fhi.mBinary)
{
using var fs = File.OpenRead(filename);
var bp = BinaryParser.FromFileVersion(fhi.mFileVersion, fs, filename);
fs.Seek(27, SeekOrigin.Begin);
parseObjects = bp.ReadFile();
}
else
{
using var reader = new StreamReader(filename);
var p = new Parser(new Tokenizer(reader, filename:filename));
var objs = p.ReadFile();
foreach (var obj in objs)
{
PrintParseObject(obj);
}
parseObjects = p.ReadFile();
}
foreach (var obj in parseObjects)
{
PrintParseObject(obj);
}
continue;
}
Expand Down
1 change: 1 addition & 0 deletions FbxCli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static void Main(string[] args)
PrintCommand.Value);
commander.Commands.Add(ExploreCommand.Value.Name,
ExploreCommand.Value);
commander.Commands.Add(InflateCommand.Value.Name, InflateCommand.Value);
if (args == null || args.Length < 1)
{
commander.ProcessArgs("help");
Expand Down
10 changes: 5 additions & 5 deletions FbxCppTests/AnimCurveNodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void AnimCurveNodeTest_Create_NoChannels()
FbxAnimCurveNode* acn = FbxAnimCurveNode::Create(manager, "");

// then:
AssertEqual(0, acn->GetChannelsCount());
AssertEqual(0, (signed int)acn->GetChannelsCount());
AssertEqual(1, CountProperties(acn));
}

Expand All @@ -23,15 +23,15 @@ void AnimCurveNodeTest_AddChannel_TwoPropertiesOneChannel()
FbxAnimCurveNode* acn = FbxAnimCurveNode::Create(manager, "");

// require:
AssertEqual(0, acn->GetChannelsCount());
AssertEqual(0, (signed int)acn->GetChannelsCount());
AssertEqual(1, CountProperties(acn));

// when:
acn->AddChannel<float>("channel1", 0.0f);

// then:
AssertEqual(2, CountProperties(acn));
AssertEqual(1, acn->GetChannelsCount());
AssertEqual(1, (signed int)acn->GetChannelsCount());
AssertEqual(0, acn->GetCurveCount(0));

FbxProperty prop = acn->GetFirstProperty();
Expand All @@ -51,15 +51,15 @@ void AnimCurveNodeTest_ConnectToChannel_AddsSrcConnection()

// require:
AssertEqual(2, CountProperties(acn));
AssertEqual(1, acn->GetChannelsCount());
AssertEqual(1, (signed int)acn->GetChannelsCount());
AssertEqual(0, acn->GetCurveCount(0));

// when:
acn->ConnectToChannel(ac, 0U);

// then:
AssertEqual(2, CountProperties(acn));
AssertEqual(1, acn->GetChannelsCount());
AssertEqual(1, (signed int)acn->GetChannelsCount());
AssertEqual(1, acn->GetCurveCount(0));
AssertEqual(1, ac->GetDstPropertyCount());
AssertEqual("channel1", ac->GetDstProperty(0).GetName());
Expand Down
71 changes: 71 additions & 0 deletions FbxCppTests/AnimCurveTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,75 @@ void FbxAnimCurve_Create_HasNamespacePrefix()
AssertEqual("AnimCurve::", obj->GetNameSpacePrefix());
}

void FbxAnimCurve_KeyGet()
{
// given:
FbxManager* manager = FbxManager::Create();
FbxAnimCurve* ac = FbxAnimCurve::Create(manager, "asdf");

// expect:
AssertEqual(0, ac->KeyGetCount());

// when:
FbxTime* time;
time = new FbxTime(100);
FbxAnimCurveKey key = FbxAnimCurveKey(*time, 1.5f);
int i;
i = ac->KeyAdd(*time, key);
AssertEqual(0, i);

// then:
AssertEqual(1, ac->KeyGetCount());
FbxAnimCurveKey key2;
key2 = ac->KeyGet(0);
AssertEqual(100LL, key2.GetTime().Get());
AssertEqual(1.5f, key.GetValue());
}

void FbxAnimCurve_KeyGet_KeysAreSortedByTimeValue()
{
// given:
FbxManager* manager = FbxManager::Create();
FbxAnimCurve* ac = FbxAnimCurve::Create(manager, "asdf");
FbxTime* time;
time = new FbxTime(0);
FbxAnimCurveKey key1 = FbxAnimCurveKey(*time, 0.5f);
int i;
i = ac->KeyAdd(*time, key1);
AssertEqual(0, i);
time = new FbxTime(2000);
FbxAnimCurveKey key2 = FbxAnimCurveKey(*time, 2.5f);
i = ac->KeyAdd(*time, key2);
AssertEqual(1, i);

// expect:
AssertEqual(2, ac->KeyGetCount());
FbxAnimCurveKey key = ac->KeyGet(0);
AssertEqual(0LL, key.GetTime().Get());
AssertEqual(0.5f, key.GetValue());
key = ac->KeyGet(1);
AssertEqual(2000LL, key.GetTime().Get());
AssertEqual(2.5f, key.GetValue());

// when:
time = new FbxTime(1000);
FbxAnimCurveKey key3 = FbxAnimCurveKey(*time, 1.5f);
i = ac->KeyAdd(*time, key3);
AssertEqual(1, i);

// then:
AssertEqual(3, ac->KeyGetCount());
key = ac->KeyGet(0);
AssertEqual(0LL, key.GetTime().Get());
AssertEqual(0.5f, key.GetValue());
key = ac->KeyGet(1);
AssertEqual(1000LL, key.GetTime().Get());
AssertEqual(1.5f, key.GetValue());
key = ac->KeyGet(2);
AssertEqual(2000LL, key.GetTime().Get());
AssertEqual(2.5f, key.GetValue());
}

void AnimCurveTest::RegisterTestCases()
{
AddTestCase(AnimCurveDef_Defaults);
Expand All @@ -509,5 +578,7 @@ void AnimCurveTest::RegisterTestCases()
AddTestCase(AnimCurve_ThreeKeyVaryInTime_EvaluationsAreCorrect);
AddTestCase(AnimCurve_ThreeKeyVaryInValue_EvaluationsAreCorrect);
AddTestCase(FbxAnimCurve_Create_HasNamespacePrefix);
AddTestCase(FbxAnimCurve_KeyGet);
AddTestCase(FbxAnimCurve_KeyGet_KeysAreSortedByTimeValue);
}

72 changes: 69 additions & 3 deletions FbxCppTests/Assertions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#include "Assertions.h"
#include "print.h"

#include <sstream>

Expand Down Expand Up @@ -40,6 +41,11 @@ void _AssertEqual(const char* expected, FbxString& actual, const char* filename,
_AssertEqual(expected, actual.Buffer(), filename, line);
}

void _AssertEqual(string& expected, FbxString& actual, const char* filename, int line)
{
_AssertEqual(expected.c_str(), actual.Buffer(), filename, line);
}

void _AssertEqual(FbxVector4 expected, FbxVector4 actual, const char* filename, int line)
{
if (expected != actual)
Expand Down Expand Up @@ -153,12 +159,72 @@ void _AssertEqual(FbxLongLong expected, FbxLongLong actual, const char* filename
}
}

void _AssertNotEqual(void* expected, void* actual, const char* filename, int line)
void _AssertEqual(FbxDateTime expected, FbxDateTime actual, const char* filename, int line)
{
if (expected != actual)
{
stringstream ss;
ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line;
throw new string(ss.str());
}
}

void _AssertEqual(FbxDataType expected, FbxDataType actual, const char* filename, int line)
{
if (!(expected == actual))
{
stringstream ss;
ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line;
throw new string(ss.str());
}
}

void _AssertEqual(long expected, long actual, const char* filename, int line)
{
if (!(expected == actual))
{
stringstream ss;
ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line;
throw new string(ss.str());
}
}

void _AssertEqual(long expected, FbxLongLong actual, const char* filename, int line)
{
if (!(expected == actual))
{
stringstream ss;
ss << "Expected " << expected << " but got " << actual << ", at " << filename << ":" << line;
throw new string(ss.str());
}
}

void _AssertEqual(int expected, long actual, const char* filename, int line)
{
_AssertEqual((long)expected, actual, filename, line);
}

void _AssertEqual(FbxTime expected, FbxTime actual, const char* filename, int line)
{
_AssertEqual(expected.Get(), actual.Get(), filename, line);
}

void _AssertNotEqual(void* not_expected, void* actual, const char* filename, int line)
{
if (not_expected == actual)
{
stringstream ss;
ss << "Expected not(" << not_expected << ") but got " << actual << ", at " << filename << ":" << line;
throw new string(ss.str());
}
}

void _AssertNotEqual(FbxDataType not_expected, FbxDataType actual, const char* filename, int line)
{
if (expected == actual)
if (not_expected == actual)
{
stringstream ss;
ss << "Expected not(" << expected << ") but got " << actual << ", at " << filename << ":" << line;
ss << "Expected not equal to " << not_expected << " but got " << actual << ", at " << filename << ":" << line;
throw new string(ss.str());
}
}
Expand Down
9 changes: 9 additions & 0 deletions FbxCppTests/Assertions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@
#ifndef __FBXCPPTESTS_ASSERTIONS_H
#define __FBXCPPTESTS_ASSERTIONS_H

#include <string>
#include <fbxsdk.h>

void _AssertEqual(int expected, int actual, const char* filename, int line);
void _AssertEqual(void* expected, void* actual, const char* filename, int line);
void _AssertEqual(const char* expected, const char* actual, const char* filename, int line);
void _AssertEqual(const char* expected, FbxString& actual, const char* filename, int line);
void _AssertEqual(std::string& expected, FbxString& actual, const char* filename, int line);
void _AssertEqual(FbxVector4 expected, FbxVector4 actual, const char* filename, int line);
void _AssertEqual(double expected, double actual, const char* filename, int line, double epsilon=0);
void _AssertEqual(FbxMatrix expected, FbxMatrix actual, const char* filename, int line, double epsilon=0);
void _AssertEqual(FbxAMatrix expected, FbxAMatrix actual, const char* filename, int line, double epsilon=0);
void _AssertEqual(FbxLongLong expected, FbxLongLong actual, const char* filename, int line);
void _AssertEqual(FbxDateTime expected, FbxDateTime actual, const char* filename, int line);
void _AssertEqual(FbxDataType expected, FbxDataType actual, const char* filename, int line);
void _AssertEqual(long expected, long actual, const char* filename, int line);
void _AssertEqual(long expected, FbxLongLong actual, const char* filename, int line);
void _AssertEqual(int expected, long actual, const char* filename, int line);
void _AssertEqual(FbxTime expected, FbxTime actual, const char* filename, int line);
void _AssertNotEqual(void* expected, void* actual, const char* filename, int line);
void _AssertNotEqual(FbxDataType expected, FbxDataType actual, const char* filename, int line);
void _AssertNull(void* actual, const char* filename, int line);
void _AssertNotNull(void* actual, const char* filename, int line);
void _AssertTrue(bool condition, const char* filename, int line);
Expand Down
Loading
Loading