how to write gtest for the following function static struct graphics_priv…
- User
how to write gtest for the following function static struct graphics_priv *overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, 1309 : int w, int h, int wraparound) { 1310 0 : struct graphics_priv *this = graphics_opengl_new_helper(meth); 1311 : 1312 0 : this->p.x = p->x; 1313 0 : this->p.y = p->y; 1314 : 1315 0 : this->width = w; 1316 0 : this->height = h; 1317 0 : this->parent = gr; 1318 0 : this->overlays = NULL; 1319 0 : this->fill_poly = 1; 1320 : 1321 : // Copy shader locations parameters 1322 0 : this->mvp_location = graphics_priv_root->mvp_location; 1323 0 : this->position_location = graphics_priv_root->position_location; 1324 0 : this->texture_position_location = graphics_priv_root->texture_position_location; 1325 0 : this->color_location = graphics_priv_root->color_location; 1326 0 : this->texture_location = graphics_priv_root->texture_location; 1327 0 : this->use_texture_location = graphics_priv_root->use_texture_location; 1328 : 1329 0 : if ((w == 0) || (h == 0)) { 1330 0 : this->overlay_autodisabled = 1; 1331 : } else { 1332 0 : this->overlay_autodisabled = 0; 1333 : } 1334 0 : this->overlay_enabled = 1; 1335 : 1336 0 : this->next = gr->overlays; 1337 0 : gr->overlays = this; 1338 : 1339 0 : create_framebuffer_texture(this); 1340 : 1341 0 : return this; 1342 : } 1343 :
- Assistant
- User
h
- Assistant
It seems like you may have accidentally sent an incomplete question. Could you please provide more details or let me know how I can assist you?
- User
how to write gtest for static void graphics_destroy(struct graphics_priv *gr) { /*FIXME graphics_destroy is never called */ gr->freetype_methods.destroy(); g_free(gr); gr = NULL; sdl_egl_destroy(gr->platform); SDL_Quit(); }
- Assistant
- User
how to write gtest for function void sdl_egl_destroy(struct graphics_opengl_platform *egl) { if (egl->eglwindow) { SDL_GL_DeleteContext(egl->eglcontext); SDL_DestroyWindow(egl->eglwindow); } // g_free(egl); //SDL_Quit(); }
- Assistant
- User
if struct graphics_opengl_platform { SDL_Window* eglwindow; SDL_GLContext eglcontext; EGLDisplay egldisplay; EGLConfig config[1]; }; is defined, how can we input egl
- Assistant
- User
how to write gtest for fucntions calling another user defined function from it
- Assistant
- User
If it is a c code, then how it will be
- Assistant
- User
So, if it so, how will be the gtest of following functionvoid draw_overlay(struct graphics_priv *gr) { struct point p_eff; GLf x[8];
get_overlay_pos(gr, &p_eff); memset(x, 0, 8*sizeof(GLf)); x[0]+=glF(1); x[1]+=glF(1); x[2]+=glF(1); x[5]+=glF(1);}
- Assistant
- User
Is it possible to write it without modifying the source code
- Assistant