From 10625e731aac5613c21f3299392f7402d669ad2e Mon Sep 17 00:00:00 2001 From: dpeter99 Date: Fri, 27 May 2022 01:18:16 +0200 Subject: [PATCH] First actual unit test --- projs/shadow-file-format-test/pch.h | 3 +++ projs/shadow-file-format-test/test.cpp | 20 ++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/projs/shadow-file-format-test/pch.h b/projs/shadow-file-format-test/pch.h index 0572a70..6a19cdc 100644 --- a/projs/shadow-file-format-test/pch.h +++ b/projs/shadow-file-format-test/pch.h @@ -5,3 +5,6 @@ #pragma once #include "gtest/gtest.h" + +#include +#include \ No newline at end of file diff --git a/projs/shadow-file-format-test/test.cpp b/projs/shadow-file-format-test/test.cpp index c0bb16c..e140181 100644 --- a/projs/shadow-file-format-test/test.cpp +++ b/projs/shadow-file-format-test/test.cpp @@ -2,7 +2,23 @@ import Shadow.FileFormat; +std::string example_str = "ShadowFileFormat_1_0_0 \n\ +Assets:{ \ + 9:textures / cube_maps / ame_ash / ashcanyon.sff, \ + 10 : textures / models / checker_board.sff, \ + 12 : shaders / skybox / skybox.sff, \ +} \ +"; + + TEST(TestCaseName, TestName) { - EXPECT_EQ(1, 1); - EXPECT_TRUE(true); + + std::stringstream ss; + ss << example_str; + + auto a = Shadow::SFF::SFFParser::ReadFromStream(ss); + + auto assets = a->GetChildByIndex(0); + + EXPECT_STREQ(assets->name.c_str(), "Assets"); } \ No newline at end of file