diff --git a/ArduinoJson.sln b/ArduinoJson.sln index 8e3ed4ea..291b3445 100644 --- a/ArduinoJson.sln +++ b/ArduinoJson.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.30723.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests\tests.vcxproj", "{2AF8ACCD-9566-462D-9A36-5BA6B0A98F33}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ArduinoJsonTests", "tests\tests.vcxproj", "{2AF8ACCD-9566-462D-9A36-5BA6B0A98F33}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ArduinoJson", "srcs\srcs.vcxproj", "{8E8F5E24-3936-4375-8F0E-1A8054BCB049}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {2AF8ACCD-9566-462D-9A36-5BA6B0A98F33}.Debug|Win32.Build.0 = Debug|Win32 {2AF8ACCD-9566-462D-9A36-5BA6B0A98F33}.Release|Win32.ActiveCfg = Release|Win32 {2AF8ACCD-9566-462D-9A36-5BA6B0A98F33}.Release|Win32.Build.0 = Release|Win32 + {8E8F5E24-3936-4375-8F0E-1A8054BCB049}.Debug|Win32.ActiveCfg = Debug|Win32 + {8E8F5E24-3936-4375-8F0E-1A8054BCB049}.Debug|Win32.Build.0 = Debug|Win32 + {8E8F5E24-3936-4375-8F0E-1A8054BCB049}.Release|Win32.ActiveCfg = Release|Win32 + {8E8F5E24-3936-4375-8F0E-1A8054BCB049}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/srcs/StaticJsonBuffer.h b/srcs/StaticJsonBuffer.h new file mode 100644 index 00000000..9103dcf6 --- /dev/null +++ b/srcs/StaticJsonBuffer.h @@ -0,0 +1,27 @@ +#pragma once + +#include "JsonBuffer.h" + +template +class StaticJsonBuffer //: public JsonBuffer +{ +public: + virtual ~StaticJsonBuffer() {} + + int capacity() + { + return CAPACITY; + } + + int size() + { + return _size; + } + +protected: + //virtual JsonNode& allocateNode(); + +private: + //JsonNode _buffer[CAPACITY]; + int _size; +}; \ No newline at end of file diff --git a/srcs/srcs.vcxproj b/srcs/srcs.vcxproj new file mode 100644 index 00000000..220e0e89 --- /dev/null +++ b/srcs/srcs.vcxproj @@ -0,0 +1,73 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {8E8F5E24-3936-4375-8F0E-1A8054BCB049} + srcs + ArduinoJson + + + + StaticLibrary + true + v120 + MultiByte + + + StaticLibrary + false + v120 + true + MultiByte + + + + + + + + + + + + + + + Level3 + Disabled + true + + + true + + + + + Level3 + MaxSpeed + true + true + true + + + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/srcs/srcs.vcxproj.filters b/srcs/srcs.vcxproj.filters new file mode 100644 index 00000000..16cf8ca4 --- /dev/null +++ b/srcs/srcs.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + \ No newline at end of file diff --git a/tests/DummyTests.cpp b/tests/DummyTests.cpp deleted file mode 100644 index 0bda8524..00000000 --- a/tests/DummyTests.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -TEST(DummyTests, EXPECT_TRUE) -{ - EXPECT_TRUE(true); -} \ No newline at end of file diff --git a/tests/StaticJsonBufferTests.cpp b/tests/StaticJsonBufferTests.cpp new file mode 100644 index 00000000..a2e62c4b --- /dev/null +++ b/tests/StaticJsonBufferTests.cpp @@ -0,0 +1,8 @@ +#include +#include + +TEST(StaticJsonBufferTests, CapacityMatchTemplateParameter) +{ + StaticJsonBuffer<42> json; + EXPECT_EQ(42, json.capacity()); +} \ No newline at end of file diff --git a/tests/tests.vcxproj b/tests/tests.vcxproj index 54248dfc..eb242917 100644 --- a/tests/tests.vcxproj +++ b/tests/tests.vcxproj @@ -14,7 +14,7 @@ {2AF8ACCD-9566-462D-9A36-5BA6B0A98F33} Win32Proj tests - ArduinoJsonTest + ArduinoJsonTests @@ -53,7 +53,7 @@ Level3 Disabled WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(SolutionDir)\third-party\gtest-1.7.0;$(SolutionDir)\third-party\gtest-1.7.0\include;%(AdditionalIncludeDirectories) + $(SolutionDir)\srcs;$(SolutionDir)\third-party\gtest-1.7.0;$(SolutionDir)\third-party\gtest-1.7.0\include;%(AdditionalIncludeDirectories) Console @@ -69,7 +69,7 @@ true true WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) - $(SolutionDir)\third-party\gtest-1.7.0;$(SolutionDir)\third-party\gtest-1.7.0\include;%(AdditionalIncludeDirectories) + $(SolutionDir)\srcs;$(SolutionDir)\third-party\gtest-1.7.0;$(SolutionDir)\third-party\gtest-1.7.0\include;%(AdditionalIncludeDirectories) Console @@ -81,7 +81,12 @@ - + + + + + {8e8f5e24-3936-4375-8f0e-1a8054bcb049} + diff --git a/tests/tests.vcxproj.filters b/tests/tests.vcxproj.filters index 13d431e2..383683cb 100644 --- a/tests/tests.vcxproj.filters +++ b/tests/tests.vcxproj.filters @@ -24,7 +24,7 @@ Third Party Files - + Source Files