<commit_before>#include <gtest/gtest.h>
#include "../src/include/Material.h"
#include "../src/include/interfaces/RendererInitializer.hpp"

std::string testVertexShader = "#version 120\
\
// Input vertex data, different for all executions of this shader.\
attribute vec3 vertexPosition_modelspace;\
attribute vec3 vertexColor;\
\
// Output data ; will be interpolated for each fragment.\
varying vec3 fragmentColor;\
// Values that stay constant for the whole mesh.\
uniform mat4 MVP;\
\
void main(){\
\
        // Output position of the vertex, in clip space : MVP * position\
        gl_Position =  MVP * vec4(vertexPosition_modelspace,1);\
\
        // The color of each vertex will be interpolated\
        // to produce the color of each fragment\
        fragmentColor = vertexColor;\
}";
std::string testFragmentShader = "#version 120\
\
uniform sampler2D texture;\
// Interpolated values from the vertex shaders\
varying vec3 fragmentColor;\
\
void main(){\
\
        // Output color = color specified in the vertex shader,\
        // interpolated between all 3 surrounding vertices\
        gl_FragColor = vec4(fragmentColor, 1);\
}";

TEST(materialTest, materialCreationTest){
  std::shared_ptr<mpr::RendererInitializer> r(new mpr::RendererInitializer);
  mpr::Material m (r, testVertexShader, testFragmentShader);
  ASSERT_EQ(1,1);
}
TEST(materialTest, uniformParseTest){
  std::shared_ptr<mpr::RendererInitializer> r(new mpr::RendererInitializer);
  mpr::Material m (r, testVertexShader, testFragmentShader);
  ASSERT_EQ(m.getUniformTypes().size(),2);
}
TEST(materialTest, attributeParseTest){
  std::shared_ptr<mpr::RendererInitializer> r(new mpr::RendererInitializer);
  mpr::Material m (r, testVertexShader, testFragmentShader);
  ASSERT_EQ(m.getAttributeTypes().size(),2);
}<commit_msg>Fix material test<commit_after>#include <gtest/gtest.h>
#include "../src/include/Material.h"
#include "../src/include/interfaces/RenderSystem.hpp"

std::string testVertexShader = "#version 120\
\
// Input vertex data, different for all executions of this shader.\
attribute vec3 vertexPosition_modelspace;\
attribute vec3 vertexColor;\
\
// Output data ; will be interpolated for each fragment.\
varying vec3 fragmentColor;\
// Values that stay constant for the whole mesh.\
uniform mat4 MVP;\
\
void main(){\
\
        // Output position of the vertex, in clip space : MVP * position\
        gl_Position =  MVP * vec4(vertexPosition_modelspace,1);\
\
        // The color of each vertex will be interpolated\
        // to produce the color of each fragment\
        fragmentColor = vertexColor;\
}";
std::string testFragmentShader = "#version 120\
\
uniform sampler2D texture;\
// Interpolated values from the vertex shaders\
varying vec3 fragmentColor;\
\
void main(){\
\
        // Output color = color specified in the vertex shader,\
        // interpolated between all 3 surrounding vertices\
        gl_FragColor = vec4(fragmentColor, 1);\
}";

TEST(materialTest, materialCreationTest){
  std::shared_ptr<mpr::RenderSystem> r(new mpr::RenderSystem);
  mpr::Material m (r, testVertexShader, testFragmentShader);
  ASSERT_EQ(1,1);
}
TEST(materialTest, uniformParseTest){
  std::shared_ptr<mpr::RenderSystem> r(new mpr::RenderSystem);
  mpr::Material m (r, testVertexShader, testFragmentShader);
  ASSERT_EQ(m.getUniformTypes().size(),2);
}
TEST(materialTest, attributeParseTest){
  std::shared_ptr<mpr::RenderSystem> r(new mpr::RenderSystem);
  mpr::Material m (r, testVertexShader, testFragmentShader);
  ASSERT_EQ(m.getAttributeTypes().size(),2);
}
{'fraction_non_alphanumeric': 0.12306827760606912, 'fraction_numerical': 0.011801067715650464, 'mean_word_length': 4.305514157973175, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7014466', 'n_tokens_mistral': 1076, 'n_tokens_neox': 1036, 'n_words': 298}