mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
[c] colorizer tests
This commit is contained in:
parent
0f32c8e950
commit
4f3dfc420f
30
extensions/cpp/test/colorize-fixtures/test.c
Normal file
30
extensions/cpp/test/colorize-fixtures/test.c
Normal file
|
@ -0,0 +1,30 @@
|
|||
/* C Program to find roots of a quadratic equation when coefficients are entered by user. */
|
||||
/* Library function sqrt() computes the square root. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h> /* This is needed to use sqrt() function.*/
|
||||
int main()
|
||||
{
|
||||
float a, b, c, determinant, r1,r2, real, imag;
|
||||
printf("Enter coefficients a, b and c: ");
|
||||
scanf("%f%f%f",&a,&b,&c);
|
||||
determinant=b*b-4*a*c;
|
||||
if (determinant>0)
|
||||
{
|
||||
r1= (-b+sqrt(determinant))/(2*a);
|
||||
r2= (-b-sqrt(determinant))/(2*a);
|
||||
printf("Roots are: %.2f and %.2f",r1 , r2);
|
||||
}
|
||||
else if (determinant==0)
|
||||
{
|
||||
r1 = r2 = -b/(2*a);
|
||||
printf("Roots are: %.2f and %.2f", r1, r2);
|
||||
}
|
||||
else
|
||||
{
|
||||
real= -b/(2*a);
|
||||
imag = sqrt(-determinant)/(2*a);
|
||||
printf("Roots are: %.2f+%.2fi and %.2f-%.2fi", real, imag, real, imag);
|
||||
}
|
||||
return 0;
|
||||
}
|
27
extensions/cpp/test/colorize-fixtures/test.cc
Normal file
27
extensions/cpp/test/colorize-fixtures/test.cc
Normal file
|
@ -0,0 +1,27 @@
|
|||
#if B4G_DEBUG_CHECK
|
||||
fprintf(stderr,"num_candidate_ret=%d:", num_candidate);
|
||||
for(int i=0;i<num_candidate;++i)
|
||||
fprintf(stderr,"%d,",user_candidate[i]);
|
||||
fprintf(stderr,";");
|
||||
#endif
|
||||
|
||||
void main(O obj) {
|
||||
LOG_INFO("not hilighted as string");
|
||||
LOG_INFO(obj << ", even worse; " << obj.x << " check this out.");
|
||||
// everything from this point on is interpeted as a string literal...
|
||||
O x;
|
||||
std::unique_ptr<O> o(new O);
|
||||
// sadness.
|
||||
|
||||
sprintf(options, "STYLE=Keramik;TITLE=%s;THEME=%s", ...);
|
||||
}
|
||||
|
||||
|
||||
int main2() {
|
||||
printf(";");
|
||||
// the rest of
|
||||
asm("movw $0x38, %ax; ltr %ax");
|
||||
fn("{};");
|
||||
|
||||
// the rest of
|
||||
}
|
22
extensions/cpp/test/colorize-fixtures/test.cpp
Normal file
22
extensions/cpp/test/colorize-fixtures/test.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
// classes example
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Rectangle {
|
||||
int width, height;
|
||||
public:
|
||||
void set_values (int,int);
|
||||
int area() {return width*height;}
|
||||
};
|
||||
|
||||
void Rectangle::set_values (int x, int y) {
|
||||
width = x;
|
||||
height = y;
|
||||
}
|
||||
|
||||
int main () {
|
||||
Rectangle rect;
|
||||
rect.set_values (3,4);
|
||||
cout << "area: " << rect.area();
|
||||
return 0;
|
||||
}
|
1553
extensions/cpp/test/colorize-results/test_c.json
Normal file
1553
extensions/cpp/test/colorize-results/test_c.json
Normal file
File diff suppressed because it is too large
Load diff
1520
extensions/cpp/test/colorize-results/test_cc.json
Normal file
1520
extensions/cpp/test/colorize-results/test_cc.json
Normal file
File diff suppressed because it is too large
Load diff
1025
extensions/cpp/test/colorize-results/test_cpp.json
Normal file
1025
extensions/cpp/test/colorize-results/test_cpp.json
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue