In longitudinal data, observations of response variables occur at fixed or random time points, and can be stopped by a termination event. When comparing longitudinal data for two groups, such irregular observation behavior must be considered to yield suitable results. In this article, we propose the use of nonparametric tests based on the difference between weighted cumulative mean functions for comparing two mean functions with an adjustment for difference in the timing of termination events. We also derive the asymptotic null distributions of the test statistics and examine their small sample properties through simulations. We apply our method to data from a study of liver cirrhosis.