Depth Test not getting enabled

Hi.
In my application, i have enabled the depth test using
glEnable(),as:

glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_DOUBLE);
glEnable(GL_DEPTH_TEST);

Right after that, i check whether it is enabled :

if(glIsEnabled(GL_DEPTH_TEST) == GL_TRUE)
printf(“Depth Enabled”);

But it is not getting enabled, and i am not getting an output.
Can someone explain to me what the problem is?
Thanks.

i had the same problems and after several testings i found out, that i forgot the call “glutCreateWindow”

try this :

glutInit();

glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_DOUBLE);

glutCreateWindow("");

glEnable(GL_DEPTH_TEST);

Thanks! Problem solved!!