Repository: FloatingArrayDesign/MoorDyn (language: python)

Issue:
Default argument error with C API: Waves.h
When using load library in Matlab to load the C API, the following error message is produced: 

```
------Error in the Model, Error-Causes/Messsages are :
Building libmoordyn_thunk_maci64 failed.  Compiler output is:
/usr/bin/xcrun -sdk macosx14.0 clang -I"/Applications/MATLAB_R2023a.app/extern/include" -fno-common -arch x86_64 -mmacosx-version-min=10.15 -fexceptions -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk -I"/Users/rdavies/work/wecsim_libs/WEC-Sim_Applications/Mooring/MoorDyn" -I"/Users/rdavies/work/wecsim_libs/WEC-Sim/source/functions/moorDyn" "libmoordyn_thunk_maci64.c" -o "libmoordyn_thunk_maci64.dylib" -bundle 
In file included from libmoordyn_thunk_maci64.c:27:
In file included from /Users/rdavies/work/wecsim_libs/WEC-Sim/source/functions/moorDyn/MoorDyn2.h:39:
/Users/rdavies/work/wecsim_libs/WEC-Sim/source/functions/moorDyn/Waves.h:77:59: error: C does not support default arguments
                                        MoorDynSeafloor seafloor = 0);
```

I worked around it by removing the seafloor input at line 76 in Waves.h and at line 899 in Waves.cpp. At line 909  in Waves.cpp I replaced the seafloor variable with 0. This a temporary fix because it removes the capability, but necessary for use of the C API. 

Note: we are not using the Matlab wrapper with WECSim because of compatibility issues with older versions of Matlab  


Discussion / hints:
Yeah, @AlexWKinley we should be careful of not adding C++ stuff on the .h files.

We are fixing this for 2.2.2
Since this require changing the ABI, I decided to move this to the next minor release, 2.3.0

Fix patch:
diff --git a/source/Waves.h b/source/Waves.h
index 35f69c8f..f3ebccc0 100644
--- a/source/Waves.h
+++ b/source/Waves.h
@@ -74,7 +74,7 @@ extern "C"
 	                                double Ud[3],
 	                                double* zeta,
 	                                double* PDyn,
-	                                MoorDynSeafloor seafloor = 0);
+	                                MoorDynSeafloor seafloor);
 
 	/** @brief Compute the wave number
 	 * @param Omega The wave angular frequency


Test patch:
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 8257f9bd..6ebcbbb2 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -5,17 +5,24 @@ file(GLOB MooringConfigFiles ${CMAKE_SOURCE_DIR}/tests/Mooring/*.stl
 add_custom_target(Test_MooringConfigFiles)
 add_custom_command(TARGET Test_MooringConfigFiles PRE_BUILD
                    COMMAND ${CMAKE_COMMAND} -E
-                        copy_directory ${CMAKE_SOURCE_DIR}/tests/Mooring ${CMAKE_CURRENT_BINARY_DIR}/Mooring)
+                        copy_directory ${CMAKE_SOURCE_DIR}/tests/Mooring ${CMAKE_CURRENT_BINARY_DIR}/Mooring
+)
 if(WIN32)
     add_custom_command(TARGET Test_MooringConfigFiles POST_BUILD
-                       COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:moordyn> ${CMAKE_CURRENT_BINARY_DIR}/)
+                       COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:moordyn> ${CMAKE_CURRENT_BINARY_DIR}/
+    )
     if(${FORTRAN_WRAPPER})
         add_custom_command(TARGET Test_MooringConfigFiles POST_BUILD
-                           COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:moordynf> ${CMAKE_CURRENT_BINARY_DIR}/)
+                           COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:moordynf> ${CMAKE_CURRENT_BINARY_DIR}/
+        )
     endif()
 endif()
 
-set(TESTS 
+set(C_TESTS 
+    c_api
+)
+
+set(CPP_TESTS 
     minimal
     lifting
     pendulum
@@ -28,9 +35,6 @@ set(TESTS
     wavekin_4
     tripod
     seafloor
-)
-
-set(CPP_TESTS 
     wavekin
     wavekin_7
     bodies
@@ -41,9 +45,9 @@ set(CATCH2_TESTS
     testDecomposeString
 )
 
-function(make_executable test_name)
+function(make_executable test_name, extension)
     set(TEST_PRIVATE_DEPS "moordyn;")
-    add_executable(${test_name} ${test_name}.cpp)
+    add_executable(${test_name} ${test_name}.${extension})
     if(USE_VTK AND MOORDYN_PACKAGE_IGNORE_VTK_DEPENDENCY)
         list(APPEND TEST_PRIVATE_DEPS VTK::CommonCore
                                          VTK::IOCore
@@ -60,25 +64,28 @@ function(make_executable test_name)
     add_dependencies(${test_name} Test_MooringConfigFiles)
 endfunction()
 
+function(make_c_executable test_name)
+    make_executable(${test_name}, "c")
+endfunction()
+
 function(make_cpp_executable test_name)
-    make_executable(${test_name})
+    make_executable(${test_name}, "cpp")
     target_include_directories(${test_name} PUBLIC ${CMAKE_BINARY_DIR}/)
 endfunction()
 
 function(make_catch2_executable test_name)
     make_cpp_executable(${test_name})
-    target_include_directories(${test_name} PUBLIC ${CMAKE_BINARY_DIR}/)
     target_link_libraries(${test_name} PRIVATE Catch2::Catch2WithMain)
 endfunction()
 
 if(USE_VTK)
-    set(TESTS "${TESTS};vtk")
+    set(CPP_TESTS "${CPP_TESTS};vtk")
 
     make_cpp_executable(wave_surface)
 endif()
 
-foreach(TEST ${TESTS})
-    make_executable(${TEST})
+foreach(TEST ${C_TESTS})
+    make_c_executable(${TEST})
     add_test(NAME ${TEST}
              COMMAND ${TEST})
 endforeach()
diff --git a/tests/c_api.c b/tests/c_api.c
new file mode 100644
index 00000000..324df266
--- /dev/null
+++ b/tests/c_api.c
@@ -0,0 +1,453 @@
+/*
+ * Copyright (c) 2022 Jose Luis Cercos-Pita <jlc@core-marine.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @file c_api.c
+ * Check that the C API can be called
+ */
+
+#include "MoorDyn.h"
+#include "MoorDyn2.h"
+#include <stdio.h>
+
+int
+main(int narg, char** arg)
+{
+	int ret_code;
+	int n;
+	unsigned int un;
+	double t=0, dt=0;
+	double d;
+
+	// MoorDyn.h
+	ret_code = MoorDynInit(NULL, NULL, "nofile");
+	if (ret_code != MOORDYN_UNHANDLED_ERROR) {
+		printf("MoorDynInit() test failed...");
+		return 255;
+	}
+	ret_code = MoorDynStep(NULL, NULL, NULL, &t, &dt);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDynStep() test failed...");
+		return 255;
+	}
+	ret_code = MoorDynClose();
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDynClose() test failed...");
+		return 255;
+	}
+	ret_code = externalWaveKinInit();
+	if (ret_code != MOORDYN_SUCCESS) {
+		printf("externalWaveKinInit() test failed...");
+		return 255;
+	}
+	getWaveKinCoordinates(NULL);
+	setWaveKin(NULL, NULL, t);
+	ret_code = GetFairTen(0);
+	if (ret_code != MOORDYN_INVALID_INPUT_FILE) {
+		printf("GetFairTen() test failed...");
+		return 255;
+	}
+	ret_code = GetFASTtens(&n, NULL, NULL, NULL, NULL);
+	if (ret_code != MOORDYN_MEM_ERROR) {
+		printf("GetFASTtens() test failed...");
+		return 255;
+	}
+	ret_code = GetPointForce(0, NULL);
+	if (ret_code != MOORDYN_MEM_ERROR) {
+		printf("GetPointForce() test failed...");
+		return 255;
+	}
+	ret_code = GetNodePos(0, 0, NULL);
+	if (ret_code != MOORDYN_MEM_ERROR) {
+		printf("GetNodePos() test failed...");
+		return 255;
+	}
+	ret_code = DrawWithGL();
+	if (ret_code != MOORDYN_MEM_ERROR) {
+		printf("DrawWithGL() test failed...");
+		return 255;
+	}
+
+	// MoorDyn2.h
+	MoorDyn system = MoorDyn_Create("nofile");
+	if (system) {
+		printf("MoorDyn_Create() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_NCoupledDOF(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_NCoupledDOF() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SetVerbosity(NULL, n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_SetVerbosity() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SetLogFile(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_SetLogFile() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SetLogLevel(NULL, n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_SetLogLevel() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Log(NULL, n, "nomsg");
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Log() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Init(NULL, NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Init() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Init_NoIC(NULL, NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Init_NoIC() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Step(NULL, NULL, NULL, NULL, &t, &dt);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Step() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Close(NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Close() test failed...");
+		return 255;
+	}
+	MoorDynWaves waves = MoorDyn_GetWaves(NULL);
+	if (waves) {
+		printf("MoorDyn_GetWaves() test failed...");
+		return 255;
+	}
+	MoorDynSeafloor seafloor = MoorDyn_GetSeafloor(NULL);
+	if (seafloor) {
+		printf("MoorDyn_GetSeafloor() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_ExternalWaveKinInit(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_ExternalWaveKinInit() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_ExternalWaveKinGetN(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_ExternalWaveKinGetN() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_ExternalWaveKinGetCoordinates(NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_ExternalWaveKinGetCoordinates() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetWaveKinCoordinates(NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetWaveKinCoordinates() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_ExternalWaveKinSet(NULL, NULL, NULL, t);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_ExternalWaveKinSet() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SetWaveKin(NULL, NULL, NULL, t);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_SetWaveKin() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetNumberBodies(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetNumberBodies() test failed...");
+		return 255;
+	}
+	MoorDynBody body = MoorDyn_GetBody(NULL, un);
+	if (body) {
+		printf("MoorDyn_GetBody() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetNumberRods(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetNumberRods() test failed...");
+		return 255;
+	}
+	MoorDynRod rod = MoorDyn_GetRod(NULL, un);
+	if (rod) {
+		printf("MoorDyn_GetRod() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetNumberPoints(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetNumberPoints() test failed...");
+		return 255;
+	}
+	MoorDynPoint point = MoorDyn_GetPoint(NULL, un);
+	if (point) {
+		printf("MoorDyn_GetPoint() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetNumberLines(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetNumberLines() test failed...");
+		return 255;
+	}
+	MoorDynLine line = MoorDyn_GetLine(NULL, un);
+	if (line) {
+		printf("MoorDyn_GetLine() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetFASTtens(NULL, &n, NULL, NULL, NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetFASTtens() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Serialize(NULL, NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Serialize() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Deserialize(NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Deserialize() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Save(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Save() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_Load(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_Load() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_DrawWithGL(NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_DrawWithGL() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SaveVTK(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE && ret_code != MOORDYN_NON_IMPLEMENTED) {
+		printf("MoorDyn_SaveVTK() test failed...");
+		return 255;
+	}
+
+	// Body.h
+	ret_code = MoorDyn_GetBodyID(NULL, &n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetBodyID() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetBodyType(NULL, &n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetBodyType() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetBodyState(NULL, NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetBodyState() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SaveBodyVTK(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE && ret_code != MOORDYN_NON_IMPLEMENTED) {
+		printf("MoorDyn_SaveBodyVTK() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_UseBodyVTK(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE && ret_code != MOORDYN_NON_IMPLEMENTED) {
+		printf("MoorDyn_UseBodyVTK() test failed...");
+		return 255;
+	}
+
+	// Line.h
+	ret_code = MoorDyn_GetLineID(NULL, &n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineID() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineN(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineN() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineNumberNodes(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineNumberNodes() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineUnstretchedLength(NULL, &d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineUnstretchedLength() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SetLineUnstretchedLength(NULL, d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_SetLineUnstretchedLength() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SetLineUnstretchedLengthVel(NULL, d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_SetLineUnstretchedLengthVel() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineNodePos(NULL, un, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineNodePos() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineNodeTen(NULL, un, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineNodeTen() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineNodeCurv(NULL, un, &d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineNodeCurv() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineFairTen(NULL, &d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineFairTen() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetLineMaxTen(NULL, &d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetLineMaxTen() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SaveLineVTK(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE && ret_code != MOORDYN_NON_IMPLEMENTED) {
+		printf("MoorDyn_SaveLineVTK() test failed...");
+		return 255;
+	}
+
+	// Point.h
+	ret_code = MoorDyn_GetPointID(NULL, &n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetPointID() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetPointType(NULL, &n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetPointType() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetPointPos(NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetPointPos() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetPointVel(NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetPointVel() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetPointForce(NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetPointForce() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetPointNAttached(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetPointNAttached() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetPointAttached(NULL, un, NULL, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetPointAttached() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SavePointVTK(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE && ret_code != MOORDYN_NON_IMPLEMENTED) {
+		printf("MoorDyn_SavePointVTK() test failed...");
+		return 255;
+	}
+
+	// Rod.h
+	ret_code = MoorDyn_GetRodID(NULL, &n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetRodID() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetRodType(NULL, &n);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetRodType() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetRodN(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetRodN() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetRodNumberNodes(NULL, &un);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetRodNumberNodes() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetRodNodePos(NULL, un, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetRodNodePos() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_SaveRodVTK(NULL, "nofile");
+	if (ret_code != MOORDYN_INVALID_VALUE && ret_code != MOORDYN_NON_IMPLEMENTED) {
+		printf("MoorDyn_SaveRodVTK() test failed...");
+		return 255;
+	}
+
+	// Seafloor.h
+	ret_code = MoorDyn_GetDepthAt(NULL, 0.0, 0.0, &d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetDepthAt() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetAverageDepth(NULL, &d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetAverageDepth() test failed...");
+		return 255;
+	}
+	ret_code = MoorDyn_GetMinDepth(NULL, &d);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetMinDepth() test failed...");
+		return 255;
+	}
+
+	// Waves.h
+	ret_code = MoorDyn_GetWavesKin(NULL, 0.0, 0.0, 0.0, NULL, NULL, &d, &d, NULL);
+	if (ret_code != MOORDYN_INVALID_VALUE) {
+		printf("MoorDyn_GetWavesKin() test failed...");
+		return 255;
+	}
+	double k = WaveNumber(0.0, 0.0, 0.0);
+
+	return 0;
+}